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

Register java plugin in Gradle plugins #25128

Merged
merged 2 commits into from
Apr 25, 2022

Conversation

glefloch
Copy link
Member

As discussed on zulip, Quarkus Gradle plugins can't work without the java plugin. A build could fail if plugin are not applied in a correct order. This applies the java plugin by default to make sure no error can happen.

/cc @grossws @gastaldi

@quarkus-bot quarkus-bot bot added area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle labels Apr 25, 2022
@aloubyansky
Copy link
Member

@glefloch should we adjust the templates that are used for project creation as part of this PR?

@gsmet
Copy link
Member

gsmet commented Apr 25, 2022

I would keep it explicit in the generated project.

@aloubyansky
Copy link
Member

I find this confusing. Why?

@glefloch
Copy link
Member Author

I think this is a fallback to be more resilient to errors. Removing the java plugin, could lead to confusion if users need to configure java specific property ?

@aloubyansky
Copy link
Member

I am not sure there is much value in this PR then.

@glefloch
Copy link
Member Author

I tested it, the order of plugin does not create an issue. This just prevent error when user don't set set the java plugin.
This may have less interest indeed.

@grossws
Copy link
Contributor

grossws commented Apr 25, 2022

It's best practice to apply plugin if you depend on it and react to it with pluginManager.withPlugin if you have optional requirement. So I think the PR still has value.

Since plugin application is idempotent order in plugins with this patch wouldn't matter but will avoid confusion.

I tested it, the order of plugin does not create an issue

I had such issue in the past with older Gradle version (somewhere in 6.x) when plugin assumed that java is available when plugins { id("my-java-conventions") ; id("some.plugin.that.requires.java") }. See gradle/gradle/issues/15664

@aloubyansky aloubyansky merged commit 17020db into quarkusio:main Apr 25, 2022
@quarkus-bot quarkus-bot bot added this to the 2.9 - main milestone Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants