%general-entities; ]> $LastChangedBy: pierre $ $Date: 2017-09-11 12:14:03 +0200 (lun. 11 sept. 2017) $ Apache-Maven-&maven-version; Apache-Maven Introduction to Apache-Maven Apache-Maven is a tool that can be used for building and managing any Java-based project. Based on the concept of a project object model (POM), Apache-Maven can manage a project's build, reporting and documentation from a central piece of information. &lfs82_checked; Package Information Download (HTTP): Download (FTP): Download MD5 sum: &maven-md5sum; Download size: &maven-size; Estimated disk space required: &maven-buildsize; Estimated build time: &maven-time; Additional Downloads Appache-Maven needs to be built with itself, so a binary is needed: Apache-Maven Dependencies Required A JDK ( or ) User Notes: Installation of Apache-Maven First fix two issues which prevent building with Java 10: sed -e '/-surefire-/a<version>2.21.0</version>' \ -e '/<commonsLang/s/3\.5/3.7/' \ -i pom.xml Install Apache-Maven by running the following commands: install -vdm 755 ../apache-maven-bin && tar -xf ../apache-maven-&maven-version;-bin.tar.gz \ --strip-components=1 \ --directory ../apache-maven-bin && SAVEPATH=$PATH && PATH=../apache-maven-bin/bin:$PATH && mvn -DdistributionTargetDir=build \ package The test are run as part of the compilation above. Now, as the root user: install -vdm 755 /opt/maven-&maven-version; && cp -Rv apache-maven/build/* /opt/maven-&maven-version; && ln -sfvn maven-&maven-version; /opt/maven You can know reset the PATH variable and clean the source directory: PATH=$SAVEPATH && rm -rf ../apache-maven-bin Command Explanations tar ../apache-maven-&maven-version;-bin.tar.gz ... PATH=.../bin:$PATH: Extracts the Apache-Maven binary and let the system know about the binary location. mvn ... package: Compiles and tests the package, and packages it to its final format. -DdistributionTargetDir=build: Specifies the location where the built binary should be packaged. The content of this directory is ready to be copied to its final location. ln -sfvn maven-&maven-version; /opt/maven: Creates a convenience symlink. : Specifies a maven local repository for this build, instead of the default ~/.m2/repository. You may want to use this if several users are to use Apache-Maven. Configuring Apache-Maven Config Files The user settings file ~/.m2/settings.xml and the global settings file /opt/maven/conf/settings.xml ~/.m2-settings.xml /opt/maven/conf/settings.xml Configuration Information The default configuration file shipped with Apache-Maven should be sufficent for common tasks. You may want to copy the global settings file to your user one and modify it to suit your needs. You should add the mvn command to PATH. For example: cat > /etc/profile.d/maven.sh << "EOF" # Begin /etc/profile.d/maven.sh pathappend /opt/maven/bin # End /etc/profile.d/maven.sh EOF Contents Installed Programs Installed Library Installed Directory mvn, mvnDebug, and mvnyjp libjansi.so in /opt/maven/lib/jansi-native /opt/maven-&maven-version; Short Descriptions mvn is the Apache-Maven Java-based project builder and manager mvn mvnDebug turns on mvn debug mode mvnDebug mvnyjp runs mvnunder the supervision of the YourKit Java Profiler mvnyjp