11

In Java 9, you can create a JAR file with

jar --create --file=mlib/com.greetings.jar --main-class=com.greetings.Main -C mods/com.greetings .

Which has the side effect of adding the MainClass attribute to the module-info.class file in the .jar file.

Do any of the plugins support this yet, or do I need to invoke the Java 9 'jar' command directly?

Is this the right forum to be asking these questions, or is there a better place?

Cheers, Eric

Eric Kolotyluk
  • 1,958
  • 2
  • 21
  • 30

1 Answers1

6

The 'module main class' is actually an attribute of the module-info.class file. It's called ModuleMainClass and set by the Java 9's jar command. The current version (3.0.2) of maven-jar-plugin only writes the file when you specify the manifest.mainClass

Machiel
  • 602
  • 7
  • 13