slachiewicz opened a new pull request, #14090: URL: https://github.com/apache/maven/pull/14090
Forward port of #14089. After `jar:jar` on a pom-packaged project, `project.getArtifact()` carries the JAR while having the POM's coordinates. As a result, `ArtifactManager.getPath(pomArtifact)` returned the JAR. A Maven 4 plugin that does not call `setPath(pomArtifact, …)` first, such as maven-deploy-plugin 4.0.0-beta-3, then deploys the JAR as `<a>-<v>-build.pom`. `getPath()` no longer lets a pom-packaged project's main artifact shadow the POM artifact, so the POM artifact keeps its own path, the project's POM. The check compares coordinates only, so core stays unaware of packagings and plugins, as #10481 requires. An explicit `setPath()` still wins (#13256), and an artifact with those coordinates but its own path, such as a consumer POM, keeps that path. `MojoExecutor` now warns when a mojo sets a non-POM file on that artifact, naming the mojo, so plugin authors see where the state broke. It warns rather than fails, because running `jar:jar` on a pom project without publishing is legal today. Part of #10481 (MNG-8138). Related plugin fixes: apache/maven-install-plugin#457, apache/maven-deploy-plugin#753 and apache/maven-deploy-plugin#754. Maven 3 API plugins bypass `ArtifactManager`, so they still need those. Verified: `mvn jar:jar deploy:deploy` on a pom project with maven-deploy-plugin 4.0.0-beta-3 → on 4.0.0-rc-7 `test-1.0-build.pom` is the ZIP; on this branch both POMs are XML and one warning names `maven-jar-plugin:3.5.1:jar`. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
