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

Remove imports of old maven plugin classes for Gradle 7.0 build compat #657

Merged
merged 2 commits into from Apr 26, 2021

Conversation

m8nmueller
Copy link
Contributor

@m8nmueller m8nmueller commented Apr 7, 2021

The 'maven' plugin which is deprecated for quite some time is finally removed in Gradle 7.0. This also affects the related classes (their replacements already live under org.gradle.api.publish.maven).

The ShadowJavaPlugin class currently imports them which makes it incompatible with Gradle 7 at compile time. By removing the imports and using Groovy's def variable declaration, the search for those old classes is deferred to runtime, only being called when the 'maven' plugin is applied and the classes are there as expected. So this change is compatible with use of the plugin in older Gradle versions.

As Gradle emits warnings for the jcenter repository, claiming it to be removed in Gradle 8, I followed their suggestion to change it to mavenCentral.

With this change, I am able to build and use this plugin with Gradle 7.
Fixes #658

@krolik-exe
Copy link
Contributor

You Can just remove the jcenter() without replacement as GradlePluginPortal() has everything , see #659

@m8nmueller
Copy link
Contributor Author

Thanks for pointing out, @krolik-exe!

@johnrengelman johnrengelman added this to the 7.0 milestone Apr 26, 2021
@johnrengelman johnrengelman merged commit 486da28 into johnrengelman:master Apr 26, 2021
@johnrengelman johnrengelman modified the milestones: 7.0, 6.2 Apr 26, 2021
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 this pull request may close these issues.

Incompatibility with JDK 16
4 participants