090003. Install maven

What you’ll need

  • About 15 minutes
  • JDK 1.7 or later 
Preconditions:
Install JDK 1.7 or later 

References: 
External reference: 
Conventions:
 The convention to install different versions of maven create a folder name "dp" and under this folder install all versions of maven.
 The convention to create maven repositories is to create the repositories under "/dp/re".


Table of contents
  1 Heading
  1.1 Subheading
  1.1.1 minor

1. Download maven

 We can download from the link Download maven. Once we have download the file we unzip on the next folder under /dp/ apache-maven-3.5.4-bin.zip.

  In our case D:\dp\apache-maven-3.5.4.

2. Update enviroment variables

Then we have to add the next environment variable as showed below

M2
D:\dp\apache-maven-3.5.4\bin
M2_HOME
D:\dp\apache-maven-3.5.4
PATH (add the next entry)
D:\dp\apache-maven-3.5.4\bin;

3. Create the repo folder

 Then we have to create a clean repo folder under the folder /dp/re/, in our case D:\dp\re\defis-mig16. In this folder maven will download all dependencies of our project.

4. Update maven settings

 Finally we have to update the maven settings:
<localRepository>D:\dp\re\defis-mig18</localRepository>

<localRepository>D:\dp\re\defis-mig16</localRepository>
<profile>
<id>citnet</id> <repositories> <repository> <id>central</id> <url>http://central</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository> <id>thirdparty-repo</id> <url>https://webgate.ec.europa.eu/CITnet/nexus/content/repositories/thirdparty</url> </repository> <repository> <id>empl-repo</id> <url>https://webgate.ec.europa.eu/CITnet/nexus/content/repositories/empl</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> <repository> <id>empl-repo-snapshots</id> <url>https://webgate.ec.europa.eu/CITnet/nexus/content/repositories/empl-snapshots</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> <repository> <id>empl-repo-thirdparty</id> <url>https://webgate.ec.europa.eu/CITnet/nexus/content/repositories/empl-thirdparty</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>central</id> <url>http://central</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile>
In order to check that everything works fine we can type mvn -v.

See Also in the Blog:

The following reference may also be helpful:

Pending task/Challengues:
Not Applicable.

Next steps:

Using maven read tutorials

Comments