Building the multi-module project

Before we build, make sure you have the latest version of Maven installed in your path. Running the following command should give you the Maven version that's installed on your machine:

$ mvn -v 
  Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426;
2017-04-03T12:39:06-07:00)

If you don't see this output, you'll need to download Apache Maven from https://maven.apache.org and add the bin folder on the download to your operating system's PATH variable.

Let's try to build this project. There are inclusions in the root project's pom.xml to make this ready to be built on Java 9. Following is the Maven compiler plugin used to set the Java version to 9:

    <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-compiler-plugin</artifactId> 
     <version>3.6.2</version> 
     <configuration> 
       <release>9</release> 
     </configuration> 
    </plugin> 

With this, you should be able to run Maven's build command and have the Java 9 compiler compile our classes. Switch to the 12-build-tools-and-testing/01-maven-integration/root directory and run the following command:

$ mvn clean install 

The output below, truncated for readability, indicates that all the modules have been compiled:

[INFO] Reactor Summary: 
[INFO] 
[INFO] root ........................................ SUCCESS [  0.379 s] 
[INFO] lib ......................................... SUCCESS [  3.646 s] 
[INFO] main ........................................ SUCCESS [  0.195 s] 
[INFO] ----------------------------------------------------------------- 
[INFO] BUILD SUCCESS
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.106.237