maven-jar-plugin fails on opendj-server-legacy after updating to wrensec-parent 3.x
Closed this issue · 2 comments
Summary
After upgrading Wren:DS to use wrensec-parent-3.0.0-SNAPSHOT
, the build fails to complete successfully when building opendj-server-legacy
.
Affects Version
4.0.0-SNAPSHOT (at 513505e
)
Environment
- Ubuntu 16.04.5 LTS
- Apache Maven 3.3.9
- Java 1.8.0_181-b13
Steps
Within the wrends
folder checked out to master
, run the following command:
mvn clean install -DskipTests -Denforcer.skip=true -DignoreArtifactSigs -DskipTests
Expected
The build succeeds without error.
Actual
The build fails during the maven-jar-plugin
execution of the opendj-server-legacy
module:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:3.1.0:jar (build-bootstrap-client-jar) on project opendj-server-legacy: You have to use a classifier to attach supplemental artifacts to the project instead of replacing them. -> [Help 1]
Root Cause
The project builds many JARs with different names, but without any classifiers. In the 3.x version of the maven-jar-plugin
, classifiers are now mandatory. But, adding them will cause the JARs to be renamed.
The underlying issue is that the JAR plugin is misused to create multiple JARs that are not part of the project per se. And it worked probably because the last execution simply won at being the main output artifact.
Simply attaching classifiers to all the artifacts will have a side effect that the module will officially produce multiple artifacts. With the current behavior the module contributes just a single artifact. But I guess that might not be an issue if the module is never used as a dependency and is not supposed to be deployed to M2 repo.
This issue seems to have been fixed with c234315.