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

#785 - define JPMS module names #787

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Djaytan
Copy link

@Djaytan Djaytan commented Jan 12, 2025

Summary

The goal of this change is to encourage Gradle to put the framework's Jar files in the module path instead of the classpath. For that, we need to explicitly define the Automatic-Module-Name attribute in the MANIFEST.MF files in framework's Jar files (source).

The newly added attribute follows this format: <groupId>.<moduleName> (e.g. org.incendo.cloud.core).

Details about this change can be found here: #785.

Impact

There is no impact nor on maintainer side nor or consumer one not relying on JPMS.

For the ones already relying on JPMS (e.g. Maven users), they will just have to adapt the references in their module-info.java files as follow:

From:

module my.module {
  [...]
  requires cloud.core;
  [...]
}

To:

module my.module {
  [...]
  requires org.incendo.cloud.core;
  [...]
}

Closes #785

## Summary

The goal of this change is to encourage Gradle to put the framework's Jar files in the module path instead of the classpath. For that, we need to explicitly define the `Automatic-Module-Name` attribute in the `MANIFEST.MF` files in framework's Jar files (source: https://docs.gradle.org/current/userguide/java_library_plugin.html#using_libraries_that_are_not_modules).

The newly added attribute follows this format: `<groupId>.<moduleName>` (e.g. `org.incendo.cloud.core`).

Details about this change can be found here: Incendo#785.

## Impact

There is no impact nor on maintainer side nor or consumer one not relying on JPMS.

For the ones already relying on JPMS (e.g. Maven users), they will just have to adapt the references in their `module-info.java` files as follow:

From:
```java
module my.module {
  [...]
  requires cloud.core;
  [...]
}
```

To:
```java
module my.module {
  [...]
  requires org.incendo.cloud.core;
  [...]
}
```

Closes Incendo#785
@Djaytan Djaytan force-pushed the build/define-jpms-modules-name branch from 090ed76 to 878a12f Compare January 12, 2025 21:48
Djaytan added a commit to Djaytan/cloud-translations that referenced this pull request Jan 14, 2025
_This change is similar to Incendo/cloud#787
Djaytan added a commit to Djaytan/cloud-discord that referenced this pull request Jan 14, 2025
_This change is similar to Incendo/cloud#787
Djaytan added a commit to Djaytan/cloud-spring that referenced this pull request Jan 14, 2025
_This change is similar to Incendo/cloud#787
Djaytan added a commit to Djaytan/cloud-cli that referenced this pull request Jan 14, 2025
_This change is similar to Incendo/cloud#787
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.

Defining Java Jigsaw modules (JPMS)
1 participant