Skip to content

Conversation

@rcw3bb
Copy link
Contributor

@rcw3bb rcw3bb commented Oct 4, 2025

This pull request introduces significant updates to support Gradle 9.x and modern Java versions, while removing compatibility with older Gradle and Java versions. It updates the documentation, build configuration, test dependencies, and core plugin logic to align with these changes. The most important changes are grouped below:

Support for Newer Gradle and Java Versions:

  • Added support for Gradle 9.x and raised the minimum required Java version to 17 in both the plugin logic and documentation. This includes updating compatibility tables and example build files in README.md. [1] [2] [3] [4] [5] [6] [7]
  • Updated the Gradle wrapper to use version 8.11, reflecting the new baseline for plugin development and testing.

Dependency and API Updates:

  • Upgraded JUnit dependencies in example build files to version 5.10.x and added the junit-platform-launcher for improved test support. [1] [2]
  • Refactored code to use newer Gradle APIs (getMainClass() instead of deprecated getMain(), getDestinationDirectory() instead of getOutputDir(), and replaced ApplicationPluginConvention with JavaApplication). [1] [2] [3] [4] [5] [6]

Internal Logic and Compatibility Handling:

  • Updated internal logic to handle dependency resolution more robustly, especially when configurations cannot be resolved, and to ensure compatibility with Gradle 8.11+ APIs. [1] [2] [3]
  • Cleaned up test logic and test project support to only target supported Gradle versions (removed references to older versions and settings files in tests). [1] [2] [3] [4] [5] [6]

These changes modernize the plugin, streamline its usage with current tools, and ensure a smoother experience for users on the latest Gradle and Java platforms.

rcw3bb added 2 commits October 5, 2025 02:43
…9.0+, and update Java source compatibility to 17. Refactor test dependencies and improve task handling in the module plugin.
@xzel23
Copy link

xzel23 commented Oct 4, 2025

Nice!

When bumping the Gradle and Java version, the shadow plugin should also be updated. It's easy to miss because the identifier has changed. See the note on the plugin page . The plugin with the old identifier will see no updates anymore.

build.gradle.kts:

    id 'com.github.johnrengelman.shadow' version '7.1.2'

should become

    id 'com.gradleup.shadow' version '9.2.2'

Copy link
Collaborator

@big-andy-coates big-andy-coates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Myself and others will really appreciate you finding the time to raise this PR - thanks @rcw3bb

Looks like a pretty comprehensive and careful upgrade.

I think raising the bar to JDK17 isn't ideal, but acceptable, assuming there is no workable alternative. Those on older Java versions can stay on the older version of the plugin. What drove the need to update the minimum Java version?

I'm also assuming there's a good reason why the minimum Gradle version is 8.11. This was released less than a year ago. It would be nice if we could support 8.0 and beyond. However, if that's not easily possible, then I don't consider it a blocker. What's stopping supporting versions down to 8.0?

I've commented on a few minor points in the PR. If you can find the time to address them it would be appreciated.

rcw3bb and others added 4 commits October 10, 2025 03:23
Co-authored-by: Andy Coates <[email protected]>
…to Java 11. Change to buildScan to develocity since the enterprise is already deprecated.
@rcw3bb
Copy link
Contributor Author

rcw3bb commented Oct 10, 2025

Hi @big-andy-coates,

Myself and others will really appreciate you finding the time to raise this PR - thanks @rcw3bb

Looks like a pretty comprehensive and careful upgrade.

I think raising the bar to JDK17 isn't ideal, but acceptable, assuming there is no workable alternative. Those on older Java versions can stay on the older version of the plugin. What drove the need to update the minimum Java version?

The artifact generated will stay on Java 11. But during development of this plugin, Java 17 is required since it's the minimum to run in Gradle 9.0 and also the minimum version needed by shadow plugin 9.2.2.

I'm also assuming there's a good reason why the minimum Gradle version is 8.11. This was released less than a year ago. It would be nice if we could support 8.0 and beyond. However, if that's not easily possible, then I don't consider it a blocker. What's stopping supporting versions down to 8.0?

In Gradle 9.0, the ProjectDependency.getDependencyProject() was totally removed and ProjectDependency.getPath() remains. The last was introduced in Gradle 8.11.

String getPath()
Get the path to the project that this dependency refers to relative to its owning build.
Since:
8.11

From: https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/ProjectDependency.html#getPath()

I've commented on a few minor points in the PR. If you can find the time to address them it would be appreciated.

@big-andy-coates
Copy link
Collaborator

big-andy-coates commented Oct 10, 2025

Hi @rcw3bb

The artifact generated will stay on Java 11. But during development of this plugin, Java 17 is required since it's the minimum to run in Gradle 9.0 and also the minimum version needed by shadow plugin 9.2.2.

I can see that your most recent commit changed the sourceCompatibility and targetCompatibility back to 11, which is great!

However, looks like the build is failing...

@rcw3bb
Copy link
Contributor Author

rcw3bb commented Oct 11, 2025

Hi @big-andy-coates , I've updated the workflow, can you try the build when you have time?

@big-andy-coates
Copy link
Collaborator

Running...

@rcw3bb
Copy link
Contributor Author

rcw3bb commented Oct 16, 2025

Hi @big-andy-coates , is there still work to do in this PR or it can be possibly merged?

@big-andy-coates
Copy link
Collaborator

On holiday... urgent?

@rcw3bb
Copy link
Contributor Author

rcw3bb commented Oct 16, 2025

No, have a good holiday. I can wait.

Copy link
Collaborator

@big-andy-coates big-andy-coates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @rcw3bb !

@big-andy-coates big-andy-coates merged commit d9209db into java9-modularity:master Oct 30, 2025
1 check passed
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.

3 participants