The AbstractArchiveTask.version property has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use the archiveVersion property instead. See AbstractArchiveTask - Gradle DSL Version 6.2 for more details.
However, when I changed âversionâ to âarchiveVersionâ, the manifest in my jar file showed the wrong version number (using âversionâ gives the correct version number). What am I missing?!
Just occurred to me: maybe I have to set archiveVersion explicitly - if so, does this mean that version and archiveVersion can have different values? If so, why?
Apparently archiveVersion only applies to the âjarâ task, not âpublishingâ⌠Anybody have an explanation? Also, the error message could have been a bit more explicitâŚ!
Iâve been confused about this too. My understanding is that the top level version property is not deprecated, only the version property in the archive tasks. I believe the archiveVersion is automatically populated from the project.version (at least in a java project) but it sounds like youâre not seeing that?
Youâre right, I didnât see that. I am now using archiveVersion for jar file creation, and version for everything else. This seems to suggest that the Gradle designers want to allow these to be different⌠but why would they want to?
So whatâs the fix? It isnât clear how severe the error is.
"The AbstractArchiveTask.version property has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use the archiveVersion property instead. See https://docs.gradle.org/6.2.2/dsl/org.gradle.api.tasks.bundling.AbstractArchiveTask.html#org.gradle.api.tasks.bundling.AbstractArchi
veTask:version for more details."
It is refering to this version correct?
group = âcom.blah.blahâ version = "1.0-SNAPSHOT"
buildDir = file(âoutâ)
How do you set the archiveVersion, AbstractArchiveTask().archiveVersion = doesnât work.
This still seems confusing: in the jar section of my build.gradle I have archiveVersion = '2.20.10' manifest { attributes 'Implementation-Title': ...', 'Implementation-Version': archiveVersion,'etc.
which seems pretty explicit, but I still have to fill in the manifest version no. by hand! Any idea why?!
Thanks, @exeba ! However, a few months ago I discovered that I could say project.version in my jar section, which simplifies things! Not sure if I can do that in my publishing section�
You should be able to put the version outside the âjarâ section, something like:
version = '0.0.1'
group = 'org.foo'
jar {
manifest {
attributes 'Implementation-Title': 'Foo', 'Implementation-Version': archiveVersion
}
}
The jar task by default sets archiveVersion = project.version (â0.0.1â)
The publishing section should do the same, i.e. taking the version from project.version unless you override it.