Controlling the Final Name of Maven JAR Artifacts
In Maven, the finalName property allows developers to specify the final name of the generated JAR artifact, which is used for both the file name and the artifact identifier in repositories.
Understanding the Issue
The provided example sets the finalName property in the
Solution
If you are using Maven 3 or later, you can set the finalName property directly in the
<build> <finalName>WhatEverYouLikey</finalName> </build>
For older versions of Maven, you will need to configure the finalName property within the Maven Jar Plugin configuration section:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <finalName>myJar</finalName> </configuration> </plugin>
By following these instructions, you can modify the final name of the JAR artifact to meet your specific requirements.
The above is the detailed content of How to control the final name of Maven JAR artifacts?. For more information, please follow other related articles on the PHP Chinese website!