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

Cannot compile with picocli-shell-jline3 dependency using Maven #1291

Closed
sualeh opened this issue Jan 1, 2021 · 10 comments
Closed

Cannot compile with picocli-shell-jline3 dependency using Maven #1291

sualeh opened this issue Jan 1, 2021 · 10 comments

Comments

@sualeh
Copy link
Contributor

sualeh commented Jan 1, 2021

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.

@sualeh
Copy link
Contributor Author

sualeh commented Jan 1, 2021

@deining - copying you for information too.

@remkop
Copy link
Owner

remkop commented Jan 2, 2021

@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.

@sualeh
Copy link
Contributor Author

sualeh commented Jan 2, 2021

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>

dejan2609 added a commit to dejan2609/picocli that referenced this issue Jan 2, 2021
…anged: Gradle configuration is switched (from 'implementation' to 'api') for 'org.jline:jline' dependency

note: solves broken build issues for any Maven project that uses 'picocli-shell-jline3' version 4.6.0
@dejan2609
Copy link
Contributor

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

@sualeh
Copy link
Contributor Author

sualeh commented Jan 2, 2021

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

@remkop remkop added this to the 4.6.1 milestone Jan 3, 2021
@remkop
Copy link
Owner

remkop commented Jan 3, 2021

Yes will do.

remkop pushed a commit that referenced this issue Jan 3, 2021
… Gradle configuration is switched (from 'implementation' to 'api') for 'org.jline:jline' dependency

note: solves broken build issues for any Maven project that uses 'picocli-shell-jline3' version 4.6.0
@remkop
Copy link
Owner

remkop commented Jan 3, 2021

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

@remkop remkop closed this as completed Jan 3, 2021
@deining
Copy link
Contributor

deining commented Jan 4, 2021

@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.

@remkop
Copy link
Owner

remkop commented Jan 4, 2021

@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!

@dejan2609
Copy link
Contributor

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 ☺️

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

MarkoMackic pushed a commit to MarkoMackic/picocli that referenced this issue Oct 17, 2021
…anged: Gradle configuration is switched (from 'implementation' to 'api') for 'org.jline:jline' dependency

note: solves broken build issues for any Maven project that uses 'picocli-shell-jline3' version 4.6.0
MarkoMackic pushed a commit to MarkoMackic/picocli that referenced this issue Oct 17, 2021
MarkoMackic added a commit to MarkoMackic/picocli that referenced this issue Oct 17, 2021
MarkoMackic added a commit to MarkoMackic/picocli that referenced this issue Oct 17, 2021
…le is changed: Gradle configuration is switched (from 'implementation' to 'api') for 'org.jline:jline' dependency"

This reverts commit 4db977c.
MarkoMackic added a commit to MarkoMackic/picocli that referenced this issue Oct 17, 2021
MarkoMackic added a commit to MarkoMackic/picocli that referenced this issue Oct 17, 2021
…le is changed: Gradle configuration is switched (from 'implementation' to 'api') for 'org.jline:jline' dependency"

This reverts commit 4db977c.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants