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

Build as Java 9 modules #70

Open
gnodet opened this issue Dec 16, 2016 · 9 comments
Open

Build as Java 9 modules #70

gnodet opened this issue Dec 16, 2016 · 9 comments

Comments

@gnodet
Copy link
Member

gnodet commented Dec 16, 2016

No description provided.

@metacodez
Copy link

metacodez commented Jul 4, 2018

It would help other Java 9 modules and their module-info.java declaration to put an entry into the JAR's Manifest-File, such as: Automatic-Module-Name: org.jline.terminal to get stable module references. In Maven, this can be achieved by tweaking the maven-jar-plugin similar to:

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-jar-plugin</artifactId>
	<configuration>
		<archive>
			...
			<manifestEntries>
				<Automatic-Module-Name>org.jline.terminal</Automatic-Module-Name>
			</manifestEntries>
		</archive>
	</configuration>
	...
</plugin>

gnodet added a commit that referenced this issue Jul 4, 2018
@gnodet
Copy link
Member Author

gnodet commented Jul 4, 2018

I have an old branch I started earlier: https://github.com/jline/jline3/tree/wip-jigsaw
I'm not really keen on integrating those changes with all the repackaged dependencies, I'd rather wait until the dependencies have their own metadata.
That said, if you want to provide a PR with the automatic module names, I'd happily merge it.

@Thihup
Copy link

Thihup commented May 20, 2021

Would now be possible to add the module-info to the project?
There are two ways: requiring a JDK 9+ to build the project and adding the module-info.java or using a tool like Moditect to generate the module-info and use JDK 8 to build.

@ice1000
Copy link

ice1000 commented Sep 25, 2022

It would be very nice if this can natively support jpms, so downstream projects can use jlink.

@bowbahdoe
Copy link

Bumping. Downstream dependencies like https://github.com/ctongfei/progressbar still need a module-info from this in order to be usable with jlink

@gnodet
Copy link
Member Author

gnodet commented Aug 11, 2023

Bumping. Downstream dependencies like https://github.com/ctongfei/progressbar still need a module-info from this in order to be usable with jlink

Do you think you could rais a PR for that ?

@bowbahdoe
Copy link

@gnodet I looked into adding module descriptors (first by locally bumping to java 9 and adding them and translating to moditect after), but I ran into a few issues

  1. There are optional dependencies like jansi which are not themselves modularized (the whole tree needs to be modularized for people to not get hit with an error).

I started on that work a bit, fusesource/jansi#254.

  1. What to do about the "uberjar" that is org.jline/jline with regard to the submodules which are available separately?

https://mvnrepository.com/artifact/org.jline/jline

@bowbahdoe
Copy link

And I suppose also

  1. I'm not sure if I'm aware of all the service provider usages. (those go in the module-info too)

@gnodet
Copy link
Member Author

gnodet commented Aug 21, 2023

@gnodet I looked into adding module descriptors (first by locally bumping to java 9 and adding them and translating to moditect after), but I ran into a few issues

  1. There are optional dependencies like jansi which are not themselves modularized (the whole tree needs to be modularized for people to not get hit with an error).

I started on that work a bit, fusesource/jansi#254.

Yes, that's the problem, all dependencies have to be modularized... I'll have a look at your PR.

  1. What to do about the "uberjar" that is org.jline/jline with regard to the submodules which are available separately?

I think we need to ignore that one. If people want to use java modules, they'll have to use the thiner jars.

For services, the TerminalProvider is obviously the main one. Implementations are provided by jline-terminal, jline-terminal-jna and jline-terminal-jansi.

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

5 participants