1. Overview

In this article, We will learn about spring boot change jar name. While building spring boot application by default create jar file combination of <artifactId>-<version> for Maven and <baseName>-<version> for Gradle project. Here are different ways to change jar file name for Maven and Gradle in spring boot application.

2.1 Maven

2.1.1 Add <finalName> tag inside configuration (pom.xml)


2.1.2 Add <finalName> tag inside <build> (pom.xml)


2.1.3 Add version in the file name (pom.xml)


Do not add .jar at the end of file name. Plugin will automatically add .jar extenction.

2.2 Gradle

2.2.1 Add jar.archiveName inside build.gradle file. (build.gradle)

For Gradle add jar.archiveName with the new file name. Here need to add .jar extension at end of jar file name.


2.2.2 Add version in a jar file name (build.gradle)

If requires application version at end of file then use jar.baseName. Here do not add .jar extension at end of jar file name.


3. Conclusion

Here we learn how we can change jar file name while build Maven and Gradle application.

4. References

Was this post helpful?

Leave a Reply

Your email address will not be published. Required fields are marked *