You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "elharo (via GitHub)" <gi...@apache.org> on 2026/07/29 13:49:45 UTC

[I] [maven-4.0.x] Compat MavenArtifact.setFile() is a no-op [maven]

elharo opened a new issue, #12588:
URL: https://github.com/apache/maven/issues/12588

   # Compat MavenArtifact.setFile() is a no-op
   
   **Found in:** maven-4.0.x branch
   **File:** `compat/maven-compat/src/main/java/org/apache/maven/artifact/MavenArtifact.java` (lines ~100-102)
   **Severity:** Critical
   
   ## Description
   
   The `setFile(File file)` method immediately returns without setting the file on the delegate Maven 4 artifact:
   
   ```java
   public void setFile(File file) {
       // returns without delegating — no-op
   }
   ```
   
   This means resolved artifact file paths are never propagated back to the underlying Maven 4 artifact, causing downstream consumers to see no resolved file for any artifact resolved through the compat layer.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [maven-4.0.x] Compat MavenArtifact.setFile() is a no-op [maven]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on issue #12588:
URL: https://github.com/apache/maven/issues/12588#issuecomment-5457538598

   Closing as invalid after investigation.
   
   The file `compat/maven-compat/src/main/java/org/apache/maven/artifact/MavenArtifact.java` **does not exist** and has never existed in git history.
   
   The only `MavenArtifact.java` in the codebase is at `compat/maven-compat/src/main/java/org/apache/maven/repository/legacy/MavenArtifact.java` — a completely different class in package `org.apache.maven.repository.legacy` that implements `ArtifactTransferResource` (for transfer/download tracking), not the Maven `Artifact` interface. It has no `setFile()` method at all.
   
   All actual compat `Artifact` implementations have working `setFile()`:
   - `DefaultArtifact.setFile()` correctly stores `this.file = file`
   - `ActiveProjectArtifact.setFile()` properly delegates to both the wrapped artifact and the project's artifact
   - The Maven 4 API handles artifact files through `ArtifactManager.setPath()` which correctly propagates to Maven 3 compat


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [maven-4.0.x] Compat MavenArtifact.setFile() is a no-op [maven]

Posted by "Mazen050 (via GitHub)" <gi...@apache.org>.
Mazen050 commented on issue #12588:
URL: https://github.com/apache/maven/issues/12588#issuecomment-5444984778

   Hello, the specified file path is invalid and the `MavenArtifact.java` file does not contain a `setFile(File file)` method in `maven-4.0.x` branch


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [maven-4.0.x] Compat MavenArtifact.setFile() is a no-op [maven]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet closed issue #12588: [maven-4.0.x] Compat MavenArtifact.setFile() is a no-op
URL: https://github.com/apache/maven/issues/12588


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org