Difference between revisions of "Maven"
Line 28: | Line 28: | ||
Edit: $MAVEN/conf/setting.xml | Edit: $MAVEN/conf/setting.xml | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="xml"> |
<!-- Local repository --> | <!-- Local repository --> | ||
<localRepository>/usr/loca/DEV/m2repo</localRepository> | <localRepository>/usr/loca/DEV/m2repo</localRepository> |
Revision as of 17:14, 10 June 2014
Contents
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
<syntaxhighlight lang="bash">
ln -s /usr/local/DEV/tools/maven/bin/mvn /sbin/mvn
Check configuration
mvn -version