Installing Apache Maven

Apache Maven is used throughout this book to create both Java EE and Spring Boot applications, manage applications and dependencies, and run applications. It is available for any operating system that JDK is available for. IDEs tend to contain their own distribution of Apache Maven. In this book, however, for the sake of neutrality and making the examples future-proof, Maven is used directly, as a separate installation.

The tool can be downloaded at maven.apache.org. Downloading the latest version available is advised. Several bundles with Maven are available for download. The binary archive without sources is sufficient. In any package downloaded, executable binaries named  mvn are to be found in the /bin folder. This mvn binary provides a command-line interface to instruct Maven and represents the very part of Maven used throughout the book. Since the interface is intended to be used from a command line, appending the path to the directory of the mvn binary to the PATH system variable is recommended. To check Maven's availability on the system path, issue the following command:

> mvn --version
Apache Maven 3.5.0
Maven home: /usr/share/maven
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: cs_CZ, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-83-generic", arch: "amd64", family: "unix"

Maven is a Java-based tool. After issuing the command, Maven should print the following output, not only stating that Maven itself is available, but also indicating that Java was found in the filesystem as the JAVA_HOME environment variable was properly set.

..................Content has been hidden....................

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