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.

Provide Automatic-Module-Name for jvm target

See original GitHub issue

First of all, I had a quick look to see if this was mentioned anywhere. My apologies in case I missed something.

Cikt works perfectly well as an automatic module. Gradle, however, insists on putting it on the classpath because it doesn’t have a module descriptor or automatic module name. This makes it inconvenient to use in modular JVM projects and while inconvenience is all it causes me, it could easily lead to other hard to identify issues in more complex projects.

I reckon a full module-info.java is overkill here but an Automatic-Module-Name = clikt.jvm in the jars manifest would make the experience a lot nicer. This way, the modules name stays consistent even if the jar changes names some time in the future and it’ll also (likely) shut up Gradle. It’s also good practice anyway.

My workaround right now is essentially that, transforming the artifact to add an automatic module name. (For reference: I simply went by this)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Lafreakshowcommented, Jun 11, 2021

Only reflective access to non public classes or members will cause issues. So ::class.simpleName should be non problematic. I’m not entirely sure how things work if you try this on a non public class but I think that case would be pretty rare. And it’s not like you could do anything about it anyway. Glad I could help.

0reactions
ajaltcommented, Jun 10, 2021

Thanks for the info. The only reflection that Clikt does is ::class.simpleName, which I don’t think would cause any access violations.

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 >
Automatic-Module-Name: Calling All Java Library Maintainers
This advice for readying Java libraries for JDK 9's modularity includes best practices for naming conventions, automatic modules, ...
Read more >
Java 9 automatic modules not found - maven - Stack Overflow
I'm trying to define a Java 9 module. I have defined something like: module my.module.name { }. Then many of my files started...
Read more >
ModuleDescriptor (Java SE 9 & JDK 9 ) - Oracle Help Center
A module descriptor describes a normal, open, or automatic module. Normal modules and open modules describe their dependences , exported-packages , the services ......
Read more >
Maven project with a mix of Java 9 modules and Java 8 ...
Specify an automatic module name in the manifest of Project P8, and use that name in the requires clause of Project P9. ·...
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