I have a project with 5 modules in maven. Right now, when I do a "mvn clean install", it generates an ear containing the two jars, one war and one sar from the other modules.
All the file names contain the version, e.g., projectx-ear-2.0.0.ear, projectx-client-2.0.0.jar, etc.
I need to rename one of the jars and the final ear to omit the version in the file name. It should look like this:
projectx-ear.ear | +-- projectx-client.jar | +-- projectx-misc-2.0.0.jar | +-- projectx-sar-2.0.0.sar | \-- projectx-web-2.0.0.web
Right now I'm using the following plugins to build: maven-compiler-plugin and maven-release-plugin
What would be the best way to achieve the results I expect?
Maven won't allow any other either. Build will fail if version is not found.
of your question: If you don't specify a version there are various different outcomes: a) you will get an error... b) if you have defined the version in the dependency management of the project's parent's pom, then that version is taken. The parent of the project doesn't have to be an enclosing superproject.
From Maven documentation: pluginManagement: is an element that is seen along side plugins. Plugin Management contains plugin elements in much the same way, except that rather than configuring plugin information for this particular project build, it is intended to configure project builds that inherit from this one.
You can achieve this by specifying the finalName
property in your pom like this:
<build> <finalName>${project.artifactId}</finalName> </build>
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