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

JPMS #353

Open
palexdev opened this issue Oct 20, 2024 · 13 comments
Open

JPMS #353

palexdev opened this issue Oct 20, 2024 · 13 comments

Comments

@palexdev
Copy link

Any plan on making this compatible with modular projects?
I'm having a very hard time here trying to make it work with Gradle's extraJavaModuleInfo

@lprimak
Copy link
Contributor

lprimak commented Oct 20, 2024

Do you have a specific issue? I use resolver with modular apps all the time

@palexdev
Copy link
Author

palexdev commented Oct 20, 2024

Do you have a specific issue? I use resolver with modular apps all the time

When I add this requires shrinkwrap.resolver.api.maven to the module-info I get this error: error: module not found: shrinkwrap.resolver.api.maven

@lprimak
Copy link
Contributor

lprimak commented Oct 21, 2024

Oh, I see, are you trying to use the API outside tests?
Tests aren't usually modularized (mine aren't) so I don't see this problem.
However, I still think that should be usable from JPMS:

Have you tried requires org.jboss.shrinkwrap.resolver.api.mavn?

@palexdev
Copy link
Author

It's not a matter or names
Modules support is missing. I wonder if something like this could be done here too

@lprimak
Copy link
Contributor

lprimak commented Oct 23, 2024

By default, automatic module naming takes place, based on the dependency filename.
See https://stackoverflow.com/questions/46741907/what-is-an-automatic-module

While specific module support is nice, it's unnecessary to support JPMS clients

@palexdev
Copy link
Author

Yeah the automatic module name should work but for some reason it does not
I'm migrating to a modular library for now

@lprimak
Copy link
Contributor

lprimak commented Oct 23, 2024

I think we are trying to say the same thing...
if you get the name right it should work

@palexdev
Copy link
Author

palexdev commented Oct 23, 2024

Here's a MRE
Small Gradle project, use the run task to execute the main class

@lprimak
Copy link
Contributor

lprimak commented Oct 23, 2024

Maven please... I don't use gradle :)

@palexdev
Copy link
Author

Maven please... I don't use gradle :)

Not even IntelliJ?

@lprimak
Copy link
Contributor

lprimak commented Oct 23, 2024

This is a debugging / troubleshooting / exploration task. I really don't want to learn a new build tool :)
IntelliJ doesn't do well with automatic modules, as I had problems building with IntelliJ but it would build correctly in maven command line.

Maybe that's the root cause of your problem.

@palexdev
Copy link
Author

So, at this point, I don't really know if it's a Gradle issue or what: Documentation.

One thing is certain: it's disappointing to see such a useful library in 2024 still targeting JDK 8 and lacking proper module support. JDK 9 was released in 2017, with JDK 11 following the next year — it's time to move on, folks.

Finally, as mentioned before, I’m transitioning to another library with proper modules support. Feel free to close this issue or keep it open as a reminder for future improvement.

@lprimak
Copy link
Contributor

lprimak commented Oct 26, 2024

ShrinkWrap resolver is tested up to JDK 17 now, so it fully supports JDK 17. JDK 8 is coincidental / legacy as you mentioned, and it's still supported because there is no downside right now.

The library is primarily used for testing, and testing realm isn't really modularized often, so your issue here is really an outlier.

Will keep the issue open, and it's good practice to put in the MANIFEST.MF entry for automatic module support.
However, I really don't think this is in any way related to the problem your are facing.

palexdev added a commit to palexdev/ArchitectFX that referenced this issue Oct 27, 2024
🚚 Move classes to backend package to avoid any possible split-packages errors in the future

With this commit, we also transition from Shrinkwrap to JResolve to download artifacts from Maven as the first does not properly support Java Modules (shrinkwrap/resolver#353).
Another alternative would have been Maven Resolve, but, being a typical Apache project, that is spaghetti coding at its finest (not that shrinkwrap is any better though, but at least it worked pretty good and was easy to use)
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

No branches or pull requests

2 participants