When writing the source code for the book Exploring Java 9, I feel that I need to have the continuous integration (CI) builds for the source code. The source code is a Maven project running with Java 9. Java 9 is not supported natively on most CI servers. However, with the help of Docker, we can easily run CI builds using Java 9.
I use CircleCI to build the source code. The code below is the
circle.yml of CircleCI. Here I use the docker image
maven:3.5.0-jdk-9 to run the Maven builds.
([[ ! -d $JAVA_HOME/conf ]] && ln -s $JAVA_HOME/lib $JAVA_HOME/conf) is used to workaround the issue with error
java.lang.SecurityException: Can't read cryptographic policy directory: unlimited when starting the JVM.
Update: The Maven Docker image has been upgraded to use JDK 9 build 178, which fixed the issue. So it’s no longer required to use the workaround.
See the actual circle.yml file used for the source code.