Skip to content

Impossible to use in a fully modular application with finely grained jline libraries. #158

Closed

Description

@brett-smith

The recent addition of module-info.java, while welcome has made it impossible to use correctly in a fully modular application with JLine's finely grained jars.

For example, I am currently using jline-terminal, jline-console, jline-reader and jline-style. This means I have something like this in my apps module-info,

requires transitive org.jline.terminal;
requires transitive org.jline.reader;
requires transitive org.jline.console;
requires org.jline.style;

I now wish to add progressbar to this, but cannot be it itself has requires org.jline which is only available in the bundled jline.

The 2 workarounds I have found so far are ..

  • Only use the bundled jline. This is a shame and kinda defeats the point of modules!
  • Use the previous version of progressbar without the module-info so it acts as an automatic module. Again this is not really a solution.

I understand this is not really the fault of progressbar. It is just the way things are because of how JPMS works, and the fact that JLine even offers this choice.

However, I believe progressbar should change to accommodate this. I think it would make more sense if progressbar itself expects you to be using the finely grained JLine modules by default, and if you want to use the bundle, you have to do so yourself and may only do so in a non-modular application.

The other alternative is for progressbar to provided two differrent versions of the artifact. One that depends on (and has a module-info for) the JLine bundle, and another that depends on (and has module-info requires for) all the used finely grained modules. Other projects such as JNA do this.

Activity

  1. ctongfei commented on Jan 1, 2024

    @ctongfei
    Owner

    Thanks @brett-smith ! I guess to fix this, I just need to change

    requires org.jline;

    to

    requires org.jline.terminal;

    ?
    Of course, the maven dependencies also have to be changed.

  2. added
    dependencies
    on Jan 1, 2024
  3. ctongfei commented on Jan 2, 2024

    @ctongfei
    Owner

    Fixed by #159.

  4. brett-smith commented on Jan 2, 2024

    @brett-smith
    ContributorAuthor

    Oh, thanks for the quick merge, much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesjline

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions