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

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

Closed
brett-smith opened this issue Jan 1, 2024 · 3 comments
Labels
dependencies Pull requests that update a dependency file jline

Comments

@brett-smith
Copy link
Contributor

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.

@ctongfei
Copy link
Owner

ctongfei commented Jan 1, 2024

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.

@ctongfei ctongfei added jline dependencies Pull requests that update a dependency file labels Jan 1, 2024
@ctongfei
Copy link
Owner

ctongfei commented Jan 2, 2024

Fixed by #159.

@ctongfei ctongfei closed this as completed Jan 2, 2024
@brett-smith
Copy link
Contributor Author

Oh, thanks for the quick merge, much appreciated.

@ctongfei ctongfei mentioned this issue Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file jline
Projects
None yet
Development

No branches or pull requests

2 participants