This message was deleted.
# community-support
s
This message was deleted.
v
Well, the module name autocompletion can only work if it already know the module. So for it to work you have to already have the dependency known to IntelliJ, by first adding it as dependency and then syncing. Then you could autocomplete the module name in IntelliJ. If the new dependency is not yet known, of course there is no autocompletion in the module info, as you only add the dependency to the project by adding the module info entry and then syncing.
c
yeah, I kind of thought so šŸ˜‰ seems like a great idea for gradle to have in core, or convince intellij to add autocompletion for module info just from version catalogs
j
I don't think holding that "against" the approach is a fair argument. You also don't have code completion in the build files when you add dependencies. Apart from that, I think sometimes IDEA might suggest modules that re not on the path but used elsewhere in the project already. But I am not 100% sure. Anyway, everything else works perfectly in IDEA as with any Gradle project. I am in touch with projects using this in active development and there have been no issues I know of.
c
it's a good in theory... although, (and I'm confident it says it has a solution), what happens if people start actually using module-info in public libraries, actually I'm kind of curious how this can even work in some cases. Foolishly for example spring boot (core) doesn't have core. The exported automatic module can't match the name given in the version catalog. Now this makes me think it's always manipulating these jars, that doesn't sound great. Personally not going to use this one. It's a cool idea in theory, but I think in practice...
v
I cannot follow.
java-module-dependencies
as far as I got it does not manipulate any JARs and what other projects publish is irrelevant. It just translates the entries in
module-info.java
to dependency declarations so that you do not have to declare it twice. The final outcome is exactly the same.
c
but the entries in module-info.java have to be correct, they aren't arbitrary. JPMS only works if the jar provides a module info or automatic module
v
Yes of course
If you have non JPMS dependencies, you would just add them to the normal build script
You just don't have to redeclare the dependency that you already added to the module-info anyway, including the necessary scope
j
The names (coordinates) in the Maven repository and the module names do not have to match. They often don't. The plugin maintains a list of mappings for the libraries on Maven Central for this: https://github.com/gradlex-org/java-module-dependencies/tree/main/src/main/resources/org/gradlex/javamodule/dependencies And you can add your own mappings: https://github.com/gradlex-org/java-module-dependencies?tab=readme-ov-file#add-module-name-mapping-information-if-needed
c
which would be pointless... (generally). Either way, I think I'm just going to pass on this one. I like my auto completion too much
v
How did you collect "the libraries on Maven Central that are modules" @Jendrik Johannes?
j
But I also think it all only really makes sense if you go "full module". Which means: • You only use 3rd party libraries that have already module-info.class files • Or you patch the Jars that do not have them. For this you can use our other extra-module-info plugin, which can do a lot of things automatically now. For example computing the requires for the module-info based on the metadata. Then you can also use the jlink/jpackage tooling afterwards without hacking around the fact that some Jars are not modules. I am doing a lot of experimentation in this area at the moment and will probably publish more content on this soon. If you use these things cleanly and consistently, you can get a really neat setup with almost empty build files. So everything about your software structure is in Java directly. And Gradle moves more into the background.
How did you collect "the libraries on Maven Central that are modules
It's an automation that crawls Maven Central. Christian Stein did that: https://github.com/sormuras/modules/tree/main I pick it up from there.
And then there is also a manually maintained list that I just extend whenever I stumble over something that is missing
But unfortunately there is not always a clean relationship (looking at you java vs javax vs jakarta 😬) So you sometimes have to override something locally. But the goal is to have the common widely used cases covered.
Ultimately though, it would be great if the ecosystem would evolve in a way where Maven Repository implementations also index the module names and offer some API where you can get libraries via Module Name directly
šŸ‘Œ 1
šŸ‘ 1
c
Maybe we need a repository that auto-patch's modules that don't support JPMS
maybe we just need a new repository...
probably not worth the time to consider repository redesign and "nobody" would use it anyways
it's like nullaway metadata, it'd be nice to have a side by side publication that's easier....
I would like to say, I like the other 2 jpms modules, or at least their idea. I'm hoping to never use either ... although if I continue on my one project I'll need to because the JSR implementation doesn't have module metadata (TF)
also might use it just to test freebuilder