GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [maven-4.0.x] DefaultTransport.put() has inverted file existence check · Issue #12583 · apache/maven

[maven-4.0.x] DefaultTransport.put() has inverted file existence check #12583

New issue
Copy link
New issue
Copy link
Closed
#12612
Closed
[maven-4.0.x] DefaultTransport.put() has inverted file existence check#12583
#12612
Copy link
Labels
bugSomething isn't working

Description

@elharo
elharo
opened on Jul 29, 2026
Issue body actions

DefaultTransport.put() has inverted file existence check

Found in: maven-4.0.x branch (up to commit 5ef0ac2)
File: impl/maven-impl/src/main/java/org/apache/maven/impl/transport/DefaultTransport.java (line 101)
Severity: Critical

Description

The put() method has an inverted condition on the file existence check:

if (Files.isRegularFile(source)) {
    throw new IllegalArgumentException("source file does not exist or is not a file");
}

Files.isRegularFile(source) returns true when the source IS a regular file (exists and is valid), but the error message says the file "does not exist or is not a file". The condition should use !Files.isRegularFile(source).

This bug makes the put() method impossible to use with any valid file argument — it will always throw IllegalArgumentException for legitimate files, silently succeeding only for directories, symlinks, or non-existent paths (which will then fail downstream). The entire transport upload mechanism is effectively broken.

Expected behavior

The condition should be negated:

if (!Files.isRegularFile(source)) {
    throw new IllegalArgumentException("source file does not exist or is not a file");
}

Activity

  1. elharo
    added
    bugSomething isn't working
    on Jul 29, 2026
  2. gnodet
    added 2 commits that reference this issue on Jul 29, 2026

    fix apache#12583: Inverted file existence check in DefaultTransport.p…

    This issue will close once commit 8bb0c27 is merged into the 'master' branch.
    8bb0c27

    Fix #12583: Inverted file existence check in DefaultTransport.put()

    This issue will close once commit 286b463 is merged into the 'master' branch.
    286b463
  3. gnodet
    closed this as completedin #12612on Jul 29, 2026
  4. gnodet
    added a commit that references this issue on Jul 29, 2026

    Fix #12583: Inverted file existence check in DefaultTransport.put()

    This issue will close once commit 3789769 is merged into the 'master' branch.
    3789769
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.