remkop / picocli

Picocli is a modern framework for building powerful, user-friendly, GraalVM-enabled command line apps with ease. It supports colors, autocompletion, subcommands, and more. In 1 source file so apps can include as source & avoid adding a dependency. Written in Java, usable from Groovy, Kotlin, Scala, etc.
https://picocli.info
Apache License 2.0
4.94k stars 424 forks source link

Module info for picocli`s Spring Boot Starter not included in the released jar #2335

Closed obfischer closed 2 months ago

obfischer commented 3 months ago

The module info for picocli`s module info descriptor, which is present in the Git repository, is not included in the resulting released jar. I checked this for serveral versions.

Here is the output of the jar tool listing the content of the jar

09:11 $ jar -tvf /opt/mavencache/info/picocli/picocli-spring-boot-starter/4.7.6/picocli-spring-boot-starter-4.7.6.jar
     0 Tue May 07 21:23:52 CEST 2024 META-INF/
   258 Tue May 07 21:23:52 CEST 2024 META-INF/MANIFEST.MF
     0 Tue May 07 21:23:52 CEST 2024 picocli/
     0 Tue May 07 21:23:52 CEST 2024 picocli/spring/
     0 Tue May 07 21:23:52 CEST 2024 picocli/spring/boot/
     0 Tue May 07 21:23:52 CEST 2024 picocli/spring/boot/autoconfigure/
  1560 Tue May 07 21:23:52 CEST 2024 picocli/spring/boot/autoconfigure/PicocliAutoConfiguration.class
  2584 Tue May 07 21:23:52 CEST 2024 picocli/spring/PicocliSpringFactory.class
     0 Tue May 07 21:23:52 CEST 2024 META-INF/spring/
    60 Tue May 07 21:23:52 CEST 2024 META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
   123 Tue May 07 21:23:52 CEST 2024 META-INF/spring.factories

Please include the descriptor in the release. Thank you for all the work you do!

Relates to #1608

remkop commented 3 months ago

It looks like the module-info class is missing from all 4.7.6 jars except the main picocli jar...

obfischer commented 3 months ago

If you have a version of branch with a fix, I would be happy to test it. Currently I have some problems getting in working with jlink and my custom module infor descriptor.

obfischer commented 2 months ago

The missing module declaration leads to some warnings during the build

[INFO] --- compiler:3.13.0:compile (default-compile) @ foobar ---
[INFO] Recompiling the module because of changed dependency.
[INFO] Compiling 4 source files with javac [debug parameters release 22 module-path] to target/classes
[WARNING] /Users/obf/code/cgm/his-cli.d/initial-structure/cli/foobar/src/main/java/module-info.java:[12,32] Modul nicht gefunden: picocli.spring.boot.starter
[WARNING] /Users/obf/code/cgm/his-cli.d/initial-structure/cli/foobar/src/main/java/module-info.java:[16,32] Modul nicht gefunden: picocli.spring.boot.starter
[WARNING] /Users/obf/code/cgm/his-cli.d/initial-structure/cli/foobar/src/main/java/module-info.java:[12,32] Modul nicht gefunden: picocli.spring.boot.starter
[WARNING] /Users/obf/code/cgm/his-cli.d/initial-structure/cli/foobar/src/main/java/module-info.java:[16,32] Modul nicht gefunden: picocli.spring.boot.starter
[WARNING] /Users/obf/code/cgm/his-cli.d/initial-structure/cli/foobar/src/main/java/module-info.java:[12,32] Modul nicht gefunden: picocli.spring.boot.starter
[WARNING] /Users/obf/code/cgm/his-cli.d/initial-structure/cli/foobar/src/main/java/module-info.java:[16,32] Modul nicht gefunden: picocli.spring.boot.starter

Just for your information

remkop commented 2 months ago

Fixed in the main branch.

obfischer commented 2 months ago

Hi @remkop, I will test it today. Haven't had the time before

remkop commented 2 months ago

@obfischer I appreciate you taking the time to help with this! 🙏

obfischer commented 2 months ago

@remkop I added to each of my Maven modules a module-info.java and not it works like a charm. Looking forward to a release.