Moon Light Box

Time is Money

Linux - Install Apache Maven in CentOS7

| Comments

# cd /opt
# wget http://ftp.mirror.tw/pub/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.zip
# unzip apache-maven-3.3.9-bin.zip
# ln -s apache-maven-3.3.9 maven
# vim /etc/profile.d/maven-env.sh

export MAVEN_HOME=/opt/maven
export PATH=$PATH:$MAVEN_HOME/bin

# source /etc/profile
# vim /opt/maven/conf/settings.xml

Find this tag.
<servers>
...
  <server>
        <id>internal</id>
        <username>YOUR_ACCOUNT</username>
        <password>YOUR_PASSWORD</password>
    </server>
</servers>

Find this tag.
<mirrors>
...
  <mirror>
    <id>nexus</id>
    <url>http://192.168.1.1:8081/repository/maven-public/</url> // 192.168.1.1 is your sonatype maven nexus server IP
    <mirrorOf>*</mirrorOf>
  </mirror>
</mirrors>

Find this tag.
<profiles>
  <profile>
    <id>compiler</id>
    <properties>
      <JAVA_1_8_HOME>/usr/lib/jvm/java-1.8.0-openjdk</JAVA_1_8_HOME>
    </properties>
  </profile>
</profiles>
  
<activeProfiles>
  <activeProfile>compiler</activeProfile>
</activeProfiles>

Comments

comments powered by Disqus