java - Want to specify jar name and version both in build.gradle -
i want o specify jar name , version in build.gradle, build.gradle looks below.
apply plugin: 'java' version = "1.00.00" dependencies { compile files('../../lib/abc.jar') } jar{ manifest{ attributes ("fw-version" : "2.50.00", "${parent.manifestsectionname}") } archivename 'abc.jar' } so when
gradle clean build, expecting generated jar name abc-1.00.00.jar
but not happening, output jar name getting abc.jar , ignoring version. want specify both jar name , version, how can achieve that.
archivename 'abc.jar' in jar configuration forcing name 'abc.jar'. default format jar name ${basename}-${appendix}-${version}-${classifier}.${extension}, basename name of project , version version of project. if remove archivename line in configuration you'll have format you're after. if want name of archive different project name set basename instead, e.g.
jar { manifest{ attributes ("fw-version" : "2.50.00", "${parent.manifestsectionname}") } basename 'abc' } see https://docs.gradle.org/current/dsl/org.gradle.api.tasks.bundling.jar.html#org.gradle.api.tasks.bundling.jar:archivename more info on configuring jar task.
Comments
Post a Comment