Maven: The Complete Reference - 2.5. Maven Installation Details |
|
Maven’s download measures in at roughly 1.5 MiB, it has attained such a slim download size because the core of Maven has been designed to retrieve plugins and dependencies from a remote repository on-demand. When you start using Maven, it will start to download plugins to a local repository described in Section 2.5.1, “User-specific Configuration and Repository”. In case you are curious, let’s take a quick look at what is in Maven’s installation directory. $ ls /opt/maven -p1 LICENSE.txt NOTICE.txt README.txt bin/ boot/ conf/ lib/ LICENSE.txt contains the software license for Apache Maven. This license is described in some detail later in the section Section 2.8, “About the Apache Software License”. NOTICE.txt contains some notices and attributions required by libraries that Maven depends on. README.txt contains some installation instructions. bin/ contains the mvn script that executes Maven. boot/ contains a JAR file (classwords-1.1.jar) that is responsible for creating the Class Loader in which Maven executes. conf/ contains a global settings.xml that can be used to customize the behavior of your Maven installation. If you need to customize Maven, it is customary to override any settings in a settings.xml file stored in ~/.m2. lib/ contains a single JAR file (maven-core-3.0.3-uber.jar) that contains the core of Maven. NoteUnless you are working in a shared Unix environment, you should avoid customizing the settings.xml in M2_HOME/conf. Altering the global settings.xml file in the Maven installation itself is usually unnecessary and it tends to complicate the upgrade procedure for Maven as you’ll have to remember to copy the customized settings.xml from the old Maven installation to the new installation. If you need to customize settings.xml, you should be editing your own settings.xml in ~/.m2/settings.xml. Once you start using Maven extensively, you’ll notice that Maven has created some local user-specific configuration files and a local repository in your home directory. In ~/.m2 there will be:
NoteIn Unix (and OSX), your home directory will be referred to using a tilde (i.e. ~/bin refers to /home/tobrien/bin). In Windows, we will also be using ~ to refer to your home directory. In Windows XP, your home directory is C:\Documents and Settings\tobrien, and in Windows Vista, your home directory is C:\Users\tobrien. From this point forward, you should translate paths such as ~/m2 to your operating system’s equivalent. If you’ve installed Maven on a Mac OSX or Unix machine according to
the details in Section 2.3.1, “Installing Maven on Linux, BSD or Mac OSX”, it should be easy to upgrade to
newer versions of Maven when they become available. Simply install the
newer version of Maven (/opt/maven-3.future) next to the
existing version of Maven (/opt/maven-3.2.5). Then switch the
symbolic link /opt/maven from /opt/maven-3.2.5 to
/opt/maven-3.future. Since, you’ve already set your If you have installed Maven on a Windows machine, simply unpack Maven
to c:\Program Files\maven-3.future and update your NoteIf you have any customizations to the global settings.xml in M2_HOME/conf, you will need to copy this settings.xml to the conf directory of the new Maven installation. |