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

[gradle] JReleaser project and gradle project variables clash #1318

Open
crschnick opened this issue Apr 13, 2023 · 1 comment
Open

[gradle] JReleaser project and gradle project variables clash #1318

crschnick opened this issue Apr 13, 2023 · 1 comment
Labels
bug Something isn't working gradle Affects Gradle plugins

Comments

@crschnick
Copy link

If you try to reference the gradle project within the jreleaser scope, it always refers to the jreleaser.project by default. This can lead to bugs if you're trying to access gradle project properties.

@crschnick crschnick added the bug Something isn't working label Apr 13, 2023
@aalmiray aalmiray changed the title JReleaser project and gradle project variables clash [gradle] JReleaser project and gradle project variables clash Apr 13, 2023
@aalmiray aalmiray added the gradle Affects Gradle plugins label Apr 13, 2023
@aalmiray
Copy link
Member

aalmiray commented Apr 13, 2023

Indeed. This is true for every JReleaser DSL element whose name shadows and existing Gradle model DSL.

Current workaround: define a script variable pointing to Gradle's project under a different name, or the actual target property i.e, def projectName = project.name. This definition must be performed outside of the jreleaser extension block.

Consider choosing a different name for 2.x taking into account that core DSL might need an update as well.

Add a note to https://github.com/jreleaser/jreleaser.github.io/blob/main/docs/modules/tools/pages/jreleaser-gradle.adoc regarding this name clash and how to workardound it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gradle Affects Gradle plugins
Projects
None yet
Development

No branches or pull requests

2 participants