Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null version value is ignored in shadowJar configuration #508

Closed
alexeyOnGitHub opened this issue Aug 16, 2019 · 1 comment · Fixed by #512
Closed

null version value is ignored in shadowJar configuration #508

alexeyOnGitHub opened this issue Aug 16, 2019 · 1 comment · Fixed by #512

Comments

@alexeyOnGitHub
Copy link

Shadow Version

5.1.0

Gradle Version

5.6

Expected Behavior

I want the final artifact name to not have version number in it, so I am trying this snippet from documentation:


shadowJar {
    baseName = 'shadow'
    classifier = null
    version = null
}

also tried

shadowJar {
    classifier = null
    archiveVersion = null
}

Actual Behavior

"classifier" is removed as expected, but "version" is still added to the final artifact name.

@Bo98
Copy link

Bo98 commented Aug 19, 2019

This is caused by a breaking change in gradle/gradle#9776.

It's noted here:

Setting Property value to null uses the property convention

Previously, calling Property.set(null) would always reset the value of the property to 'not defined'. Now, the convention that is associated with the property using the convention() method will be used to determine the value of the property.

This is perhaps not very obvious however as version is documented as String and not Property<String>. In Gradle 5.1, version was deprecated and replaced by archiveVersion which is a Property<String>, and internally version just maps to archiveVersion.

Try use version = "" or archiveVersion = "" instead.

The shadowJar docs will need updating because of this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants