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

Add ability to specify module version and main class #67

Closed
plamentotev opened this issue Aug 29, 2017 · 2 comments
Closed

Add ability to specify module version and main class #67

plamentotev opened this issue Aug 29, 2017 · 2 comments
Assignees
Milestone

Comments

@plamentotev
Copy link
Member

Java 9 introduces Java Platform Module System and it comes with changes to the JAR files as well. The modules are packaged into modular JAR files - a JAR file that has module-info.class file in its top-level directory. Unlike the regular JAR files, meta information such as the module version or it's main class(for the executable JAR files) are stored inside module-info.class instead of the manifest file.

A support to set the module version and main class should be added to Plexus Archiver. This feature will help tools like Maven to produce modular JAR files.

@plamentotev plamentotev self-assigned this Aug 29, 2017
@plamentotev plamentotev added this to the 3.6 milestone Aug 29, 2017
@khmarbaise
Copy link
Member

You can already create modular jar files with Maven which means having a module-info.java (compiled) within the jar file...This can simply be achieved by using the default structure of maven and add the module-info.java in src/main/java and using a JDK 9...
Furthermore the support for Jlink / JMod plugin in its first alpha state is done (Currenty the JMod plugin needs some more things). I think within less than a week a first alpha will be available on Maven Central.

@plamentotev
Copy link
Member Author

@khmarbaise you're right, module JAR is just regular JAR file with module-info.class. I guess This feature will help tools like Maven to produce modular JAR files. is bad choice of words. I didn't mean to say that Maven cannot create modular jar. What I meant is that there are some attributes that you cannot set in the module-info.java file such as the module version and the module main class. As far I know to do that a byte code manipulation of the compiled class is required. There is discussion on the Maven dev list(https://www.mail-archive.com/dev@maven.apache.org/msg114594.html) regarding which component is best suited to do such manipulation. Please feel free to join it if you think Plexus Archiver is not the best place for such functionality or if it already exists.

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

2 participants