question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add an Automatic-Module-Name manifest entry

See original GitHub issue

Now, that Dagger runs with JDK 9 (as issue #880 is resolved), it might be time to look forward to JPMS compatibility.

In a first step I’d suggest to add a Automatic-Module-Name entry to the jar manifest. This way other libraries depending on Dagger can be published to Maven Central or other repositories. Without it, the automatic module name would be derived from the Dagger .jar file and as such is pretty unreliable.

This proposed change doesn’t affect any code and will simply make a name reservation until an actual module-info.java will be added eventually. More info can be found in this blog post.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:19 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jodastephencommented, Oct 31, 2020

Just something to bear in mind is that you can’t have two modules with the same name loaded at the same time. The list above suggests you have split packages, where the same package appears in two different jar files. If that is the case, then you can’t really modularise as is.

(The exception to that rule is if the user is expected to choose one of the artifacts, eg one of"dagger-android-jarimpl", “dagger-android-legacy” or “dagger-android-processor”.)

2reactions
JakeWhartoncommented, Mar 5, 2018

Package name seems more appropriate since it’s agnostic to build system and modules deal in exposing of packages.

On Sun, Mar 4, 2018, 10:59 PM Ron Shapiro notifications@github.com wrote:

This sounds fine to me. I presume that we’ll probably want the module names to match the maven artifact names?

  • com.google.dagger
  • com.google.dagger.compiler
  • com.google.dagger.producers
  • com.google.dagger.android
  • com.google.dagger.android.support

etc.

@netdpb https://github.com/netdpb WDYT?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/google/dagger/issues/1079#issuecomment-370303676, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEEak9rj_DO5SCnhWxtknsUuXzt722ks5tbLgxgaJpZM4SScow .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Automatic-Module-Name: Calling all Java Library Maintainers
This first step boils down to picking a module name, and adding it as Automatic-Module-Name: <module name> entry to the library's MANIFEST.
Read more >
java - What is an automatic module? - Stack Overflow
The module name of an automatic module is derived from the JAR file used to include the artifact if it has the attribute...
Read more >
Add Automatic-Module-Name to MANIFEST.MF #1243 - GitHub
Add Automatic -Module-Name to MANIFEST.MF #1243 ... I believe it's as simple as configuring the maven-jar-plugin entry in the POM:.
Read more >
JAR File Specification
A non-modular JAR file deployed on the module path is an automatic module. If the JAR file has a main attribute Automatic-Module-Name (see...
Read more >
Add automatic module name entry to MANIFEST.MF in java jar
In Java 9+, jars are supposed to have module names. If they don't (e.g., a jar built from an earlier version of Java),...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found