Skip to content

[maven-3.10.x] Warn when a mojo sets a non-POM file on a pom project's main artifact - #14092

Open
slachiewicz wants to merge 1 commit into
apache:maven-3.10.xfrom
slachiewicz:mng-8138-warning-3x
Open

slachiewicz wants to merge 1 commit into
apache:maven-3.10.xfrom
slachiewicz:mng-8138-warning-3x

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

mvn jar:jar deploy:deploy on a pom-packaged project publishes the JAR as the .pom with maven-install-plugin and maven-deploy-plugin 3.1.2 to 3.2.0, and Maven gives no hint why. MojoExecutor now warns once, naming the mojo that set a non-POM file on the artifact with the POM's coordinates. Core cannot override that file on the Maven 3 API, so the fix itself is in the plugins (apache/maven-install-plugin#457, apache/maven-deploy-plugin#753); this makes the broken state visible.

The check compares coordinates only, so it stays unaware of packagings and plugins, as #10481 requires. It warns rather than fails, because builds that run jar:jar on a pom project without publishing are legal today. Part of #10481 (MNG-8138); #14089 is the Maven 4 counterpart.

Verified: mvn jar:jar deploy:deploy with maven-deploy-plugin 3.1.4 → 3.10.1 deploys the ZIP silently; this branch prints one warning naming maven-jar-plugin:3.5.1:jar.

In a pom-packaged project, project.getArtifact() has the POM's coordinates; a file set on it by a plugin such as jar:jar can be published as the POM. Warn once, naming the mojo that set it. Part of apache#10481 (MNG-8138); the Maven 4 counterpart is apache#14089.
@slachiewicz slachiewicz added bug Something isn't working mvn3 labels Nov 21, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review November 22, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working mvn3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant