Picocli: Cannot compile with picocli-shell-jline3 dependency using Maven

Created on 1 Jan 2021  路  10Comments  路  Source: remkop/picocli

Since the change to Fix gradle warnings, Maven compilation of any project with picocli-shell-jline3 as a dependency is broken, since the artifact published to The Central Repository has a changed the scope of transitive dependencies to jline - see the following changes to scope in the published pom.xml:

    <dependency>
      <groupId>org.jline</groupId>
      <artifactId>jline</artifactId>
      <version>3.17.1</version>
      <scope>runtime</scope>
    </dependency>

whereas in former versions of picocli it was

    <dependency>
      <groupId>org.jline</groupId>
      <artifactId>jline</artifactId>
      <version>3.16.0</version>
      <scope>compile</scope>
    </dependency>

In order words, the change in how the Gradle dependency is defined has broken the Maven scope, and compilation fails.

bug dependency

All 10 comments

@deining - copying you for information too.

@sualeh Thank you for raising this!

Will applications be able to work around this by explicitly adding this dependency to their POM?

    <dependency>
      <groupId>org.jline</groupId>
      <artifactId>jline</artifactId>
      <version>3.16.0</version>
      <scope>compile</scope>
    </dependency>

If so, we can try to fix this in the next release, but in the meantime add a note for this to the documentation.

Here is the way I suggest:

    <dependency>
      <groupId>info.picocli</groupId>
      <artifactId>picocli-shell-jline3</artifactId>
      <version>4.6.0</version>
      <exclusions>
        <exclusion>
          <groupId>org.jline</groupId>
          <artifactId>jline</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.jline</groupId>
      <artifactId>jline</artifactId>
      <version>3.17.1</version>
    </dependency>

Related issue #1294 is reported by @remal (I will try to expand my PR asap).

@remkop - may I request a point release with this fix?

Yes will do.

Thanks again for raising this!
This is fixed in the 4.6.1 release.

@deining - copying you for information too.

Sorry for messing up things here. A huge thanks to everyone involved in ironing this fault out so quickly.

@deining No worries at all! 馃槈
I now finally sat down to learn the difference between api and implementation. So thank you! 馃槃
And I also think it is pretty cool how a whole bunch of people got together to help fix things so quickly. 馃檹 Truly grateful!

Don't mention it @deining ! No man is able to be a jack off all trades.. and besides that: you gave us a chance to return something to the community :relaxed:

@remkop feel free to ping me in case of some Gradle related issues :wink:

Was this page helpful?
0 / 5 - 0 ratings