Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
executable Remove redundant source/target settings Apr 6, 2017
mavenrc Remove redundant source/target settings Apr 6, 2017

Maven Java 9

Different ways to build projects on Java 9 with Maven. The goal is to be able to simply run mvn clean install and then launch the resulting JAR with java -jar target/demo-java-9.jar.

Some approaches are more intrusive, others more brittle - have a look at the individual solutions for a small discussion of its pros and cons.

💥 Compiler Arguments 💥

In case you're trying to use some of the new command line options like --add-modules, be aware that the following doesn't work:

			<arg>--add-modules java.xml.bind</arg>

With this configuration I got errors like the following:

[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] javac: invalid flag: --add-modules java.xml.bind
Usage: javac <options> <source files>
use --help for a list of possible options

Apparently it's common knowledge that <arg> will put arguments that contain a space into quotes before passing them, so I had to do the following instead:


Obvious, right? 🤔

You can’t perform that action at this time.