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

The picocli-groovy module should declare groovy-all as dependency #1613

Closed
remkop opened this issue Feb 27, 2022 · 0 comments
Closed

The picocli-groovy module should declare groovy-all as dependency #1613

remkop opened this issue Feb 27, 2022 · 0 comments
Labels
lang: groovy Groovy-related theme: build An issue or change related to the build system theme: module An issue or change related to JPMS modules type: dependency 📚
Milestone

Comments

@remkop
Copy link
Owner

remkop commented Feb 27, 2022

History: the picocli.groovy package used to be bundled inside the picocli.jar, until it was split off into a separate artifact picocli-groovy in version 4.0.

It was not desirable (#232) for the picocli.jar to depend on groovy-all (there was a version 2.0.2 published that had this dependency), and this dependency was removed in picocli 2.0.3.
In picocli 2.0.3, the groovy-all dependency was changed to a compileOnly dependency.

This compileOnly build configuration was retained even when the picocli.groovy packages were moved into the separate picocli-groovy module.

The POM for picocli-groovy now looks like this:

  <groupId>info.picocli</groupId>
  <artifactId>picocli-groovy</artifactId>
  <version>4.6.3</version>
  <name>picocli-groovy</name>
  <!-- ... -->
  <dependencies>
    <dependency>
      <groupId>info.picocli</groupId>
      <artifactId>picocli</artifactId>
      <version>4.6.3</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>

This is incorrect, since various classes in the picocli.groovy packages expose Groovy APIs.
From 4.7.0, the picocli-groovy POM will reflect this:

  <groupId>info.picocli</groupId>
  <artifactId>picocli-groovy</artifactId>
  <version>4.7.0-SNAPSHOT</version>
  <name>picocli-groovy</name>
  <!-- ... -->
  <dependencies>
    <dependency>
      <groupId>info.picocli</groupId>
      <artifactId>picocli</artifactId>
      <version>4.7.0-SNAPSHOT</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
      <version>2.4.21</version> <!-- this is the minimum version. Any higher version also works. -->
      <scope>compile</scope>
    </dependency>
  </dependencies>

This also aligns the Maven dependency in line with the module-info declaration:

module info.picocli.groovy {
    requires info.picocli;
    requires groovy.all;

    exports picocli.groovy;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang: groovy Groovy-related theme: build An issue or change related to the build system theme: module An issue or change related to JPMS modules type: dependency 📚
Projects
None yet
Development

No branches or pull requests

1 participant