Java Magazine, July/August 2018
ORACLE COM JAVAMAGAZINE JULY AUGUST 2018 57 libraries your CI server to actually execute the build several times each time with a diferent Java version Jenkins and Travis CI among others make this fairly easy Even if your build takes a long time and resources are scarce dont put this of You should build with the nonbaseline versions at least every night While this practice allows problematic commits to stay undetected for an entire day you will at least find out by next morning that something went wrong Configuring the build steps Running the build is the easy part configuration can be the difficult part It is possible that depending on the Java version running the build youll need to apply command line flags to compilation or test runs change a dependencys version or edit a build steps configuration To be able to do this you need to familiarize yourself with your build tools support for conditional configuration For Maven profiles are what youre looking for The following block creates a profile that automatically activates itself when the build runs on Java 9 or later profiles profile automatically activate the profile if running on Java 9 activation jdk 9 jdk activation version specific build configuration goes here profile profiles You can then apply a version specific configuration inside that profile block For example to export an internal package from a platform module that Google Guice depends on you could do this profile id java9 id
You must have JavaScript enabled to view digital editions.