Skip to content

[MNG-6983] Plugin key can get out of sync with artifactId and groupId #8395

Closed

Description

@jira-importer

Paul Pazderski opened MNG-6983 and commented

I have a project build with maven where some maven plugins are not executed without any warning or error shown in output. I was able to reproduce the issue with a minimal example. (see attachment)

The expected result of this example is to get the one source file compiled if you invoke mvn compile.

If I run this example using Maven 3.6.3 the following output appears:

[INFO] Scanning for projects...
[INFO]
[INFO] -------------------------< org.example:child >--------------------------
[INFO] Building child 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ child ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory [...]\pluginNotExecuted\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ child ---
[INFO] No sources to compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.644 s
[INFO] Finished at: [...]
[INFO] ------------------------------------------------------------------------

Notice that there is no execution of the build-helper-maven-plugin (and as consequence no source compiled) and no indication why it is missing.

From what I've found the problem seem to be the usage of variable in the plugins groupId. If you replace either the variable in parent- or child-pom with the actual value the build shows a warning

[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.example:child:jar:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:build-helper-maven-plugin is missing. @ line 16, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]

If you replace both variables with the actual value everything works as expected.

 

I investigated the problem further and will provide more details with a pull request for a possible fix.


Affects: 3.6.3

Attachments:

Issue Links:

  • MNG-6767 Plugin with ${project.groupId} resolved improperly
    ("fixes")
  • MNG-6799 avoid model interpolation instability risk: ensure StringVisitorModelInterpolator replaces StringSearchModelInterpolator

Remote Links:

Backported to: 4.0.0-alpha-2, 3.8.2

Activity

  1. jira-importer commented on Sep 15, 2020

    @jira-importer
    Author

    Paul Pazderski commented

    No comments? Whatever you think of the possible fix I would appreciate a comment on the failing example I attached.

    After I noticed it worked in 3.6.2 I bisect the issue and came to 3a80ae08aac785deb61e417f82560cb06209d5bc as causing commit. Apparently there is a difference between StringSearchModelInterpolator and StringVisitorModelInterpolator which make this example fail.

  2. jira-importer commented on Oct 3, 2020

    @jira-importer
    Author
  3. jira-importer commented on Jun 26, 2021

    @jira-importer
    Author

    Michael Osipov commented

    Fixed with 3645593bfa98b06f54eb8bc0874b871948651169 for maven-3.8.x branch.

  4. added
    bug
    priority:major
    on Jul 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugpriority:major

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions