简体   繁体   中英

Java jar version

How to create the jar with version number in gradle. I have the build script in gradle which creating the jar. I need to generate the jar with version number. How to achieve it using gradle script

Thanks in advance

You can use add the below script

jar {
    version='1.0'
}

So that it will generate the jar with version

Gradle will build your archive with the following pattern by default:

[baseName]-[appendix]-[version]-[classifier].[extension]

if archiveName has not been explicitly set.

version - The version part of the archive name, if any.

Applying:

jar {
    baseName = 'app'
    version='1.0'
}

Will specify the base name and the version to your archive:

app-1.0.jar

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM