Difference between revisions of "Maven"

 
(One intermediate revision by the same user not shown)
Line 28: Line 28:
 
Edit: $MAVEN/conf/setting.xml
 
Edit: $MAVEN/conf/setting.xml
  
<syntaxhighlight lang="bash">
+
<syntaxhighlight lang="xml">
 
<!-- Local repository -->
 
<!-- Local repository -->
 
<localRepository>/usr/loca/DEV/m2repo</localRepository>
 
<localRepository>/usr/loca/DEV/m2repo</localRepository>
Line 73: Line 73:
  
  
Add:
+
Add
  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 80: Line 80:
 
M2_REPO="/usr/local/DEV/m2repo"
 
M2_REPO="/usr/local/DEV/m2repo"
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
  
 
Check new values
 
Check new values
Line 85: Line 86:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
source /etc/profile
 
source /etc/profile
 +
</syntaxhighlight>
 +
  
 
Add exec symlink
 
Add exec symlink
 +
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
ln -s /usr/local/DEV/tools/maven/bin/mvn  /sbin/mvn
 
ln -s /usr/local/DEV/tools/maven/bin/mvn  /sbin/mvn

Latest revision as of 09:31, 10 September 2014


Manual install

Download last version: http://maven.apache.org/download.html


Required folders

Put it an easy to access folder: /usr/local/DEV/tools/maven

mkdir -p /usr/local/DEV/tools


Local repository

mkdir /usr/local/DEV/m2repo

MAVEN configuration and add local repository Edit: $MAVEN/conf/setting.xml

<!-- Local repository -->
<localRepository>/usr/loca/DEV/m2repo</localRepository>


LINUX configuration

Environment variable

You need to add an environment variable:

vim /etc/profile


Add:

export M2_HOME="/usr/local/DEV/tools/maven"
export M2=$M2_HOME/bin
export M2_REPO="/usr/local/DEV/m2repo"

if [ "`id -u`" -eq 0 ]; then
   PATH="[...]:$JAVA_HOME/bin:$M2"
else
	   PATH="[...]:$JAVA_HOME/bin:$M2"
fi
export PATH


Ubuntu specifics

Set environment values

vim /etc/environment


Add

M2_HOME="/usr/local/DEV/tools/maven"
M2="$M2_HOME/bin"
M2_REPO="/usr/local/DEV/m2repo"


Check new values

source /etc/profile


Add exec symlink

ln -s /usr/local/DEV/tools/maven/bin/mvn  /sbin/mvn


Check configuration

mvn -version