Maven version used: 3.5.2, 3.5.3
mvn clean package -pl <root-artifact-id>:<module-name>
is failing saying
[WARNING] Rule 3: org.apache.maven.plugins.enforcer.ReactorModuleConvergence failed with message:
Module parents have been found which could not be found in the reactor.
module: <artifact:id>:<module-name>:war:1.0-SNAPSHOT
But working fine when running the mvn clean package from the module level though. Thats the only warning message in the trace causing the enforcer to fail the package build.
It's a very old reported bug but nobody seems to do anything about it: https://issues.apache.org/jira/browse/MENFORCER-189
Root cause would be that it compares the artifactid (module-name) of the project passed in the -pl paramater with the artifactid (reactor) of its parent. Which would never be the same and thus will always give this error.
For us the fix was to disable the enforcer plugin when using this execution (other executions without the -pl like 'clean install' are fine)
mvn clean install
mvn package -pl module-name -Denforcer.skip=true
Edit:
Another option is to specify the reactor project in the build using '.' (note: this will also package the reactor)
mnv clean package -pl .,module-name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With