[GRADLE-667] War plugin version handling regressions from 0.7 Created: 29/Sep/09  Updated: 04/Jan/13  Resolved: 24/Nov/10

Status: Resolved
Project: Gradle
Affects Version/s: 0.8
Fix Version/s: 0.9-rc-1

Type: Bug
Reporter: Spencer Allain Assignee: Adam Murdoch
Resolution: Fixed Votes: 0


There are two main regressions that I've identified when setting the version explicitly to the empty string, that worked as expected in 0.7, but do not in 0.8:
Either "unspecified" or "" is added to a jar name depending upon where it is being used, but it's all related to the war plugin

usePlugin 'java'
version = '' // This is the empty string

jar file => project1.jar (this is still the same as 0.7, which is good)

usePlugin 'war'
version = '' // This is the empty string
jar.enabled = true

{ compile(project(':project1')) }

war file => project2.war (this is still the same as 0.7, which is good)
jar file => project2-unspecified.jar (it used to be project2.jar in gradle 0.7, and using just java plugin implies it still should be)

project2.war contains => project1-.jar (it used to contain project1.jar in gradle 0.7, without the unexpected "-")

Explicitly setting version = null ... or never setting it does result in consistent behavior, although it means everything is

Appendix and classifier can still both be set to the empty string and they get ignored as expected, but version is now behaving differently.

Comment by Spencer Allain [ 29/Sep/09 ]

There is a workaround for the version number being lost on jar files generated with the war plugin and re-enabling the jar creation.

jar.enabled = true
jar.version = version

The extra "-" included within the war file for projects without a non-empty version number seems to be unavoidable right now.

Comment by Adam Murdoch [ 02/Oct/09 ]

This is fixed in trunk now

Generated at Wed Jun 30 11:35:45 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.