Linux installation and configuration Maven Ali cloud images

  1. maven maven official website to download archive (tar-gz mode) to the local address as
    https://archive.apache.org/dist/maven/maven-3/3.5.4/binaries/
    Linux installation and configuration Maven Ali cloud images
  2. Maven by introducing compressed software Xftp 6
    Linux installation and configuration Maven Ali cloud images
  3. Decompression (tar -zxvf archive)
    tar -zxvf apache-maven-3.5.4-bin.tar.gz

    Linux installation and configuration Maven Ali cloud images

  4. File to the specified file decompression after moving the folder and rename (remember the path, with follow-up required environment variables)
    Linux installation and configuration Maven Ali cloud images
  5. Enter / conf directory after extracting file, settings.xml configuration file (vim settings.xml)
    Linux installation and configuration Maven Ali cloud images
  6. After entering the configuration file, first configure maven local repository, copy the 53 lines to 55 lines (: set nu show line numbers), the local repository path label configured for the individual
    <localRepository>/opt/jarstore</localRepository>

    Linux installation and configuration Maven Ali cloud images

  7. Ali cloud mirroring configuration, FIG lower position (<mirrors> disposed within the following code), save and exit
    <mirror>
    <id>alimaven</id>
    <mirrorOf>central</mirrorOf>
    <name>aliyun maven</name>
    <url>https://maven.aliyun.com/repository/central</url>
    </mirror>
    <mirror> 
    <id>aliyun-maven</id> 
    <mirrorOf>*</mirrorOf> 
    <name>aliyun maven</name> 
    <url>http://maven.aliyun.com/nexus/content/groups/public</url> 
    </mirror>

    Linux installation and configuration Maven Ali cloud images

  8. Configuration environment variable
    vim /etc/profile
  9. After entering the configuration file (path MAVEN_HOME write complete personal file compression) and finally adding the following two lines of code, save and exit
    export MAVEN_HOME=/opt/inst/maven354
    export PATH=$PATH:$MAVEN_HOME/bin

    Linux installation and configuration Maven Ali cloud images

  10. Activation profile
    source /etc/profile
  11. Often the installation is completed to see if maven
    mvn -version

    Linux installation and configuration Maven Ali cloud images

Guess you like

Origin blog.51cto.com/14497235/2430282