deepin安装maven

来源:互联网 发布:软件验收标准模板 编辑:程序博客网 时间:2024/06/03 18:48
$ mkdir -p ~/dev/Maven$ tar -zxvf apache-maven-3.5.0-bin.tar.gz -C ~/dev/Maven/$ vim ~/.profile  #在.profile文件最后追加如下内容export M2_HOME=$HOME/dev/Maven/apache-maven-3.5.0export MAVEN_OPTS="-Xms128m -Xmx1024m"export PATH=$M2_HOME/bin:$PATH

配置maven:vim ~/dev/Maven/apache-maven-3.5.0/conf/settings.xml

<?xml version="1.0" encoding="UTF-8"?><settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">  <pluginGroups>  </pluginGroups>  <proxies>  </proxies>  <servers>  </servers>  <mirrors>      <mirror>          <id>alimaven</id>          <mirrorOf>central</mirrorOf>          <name>aliyun maven</name>          <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>      </mirror>  </mirrors>  <profiles>      <profile>          <id>jdk-1.8</id>          <activation>               <activeByDefault>true</activeByDefault>              <jdk>1.8</jdk>           </activation>          <properties>               <maven.compiler.source>1.8</maven.compiler.source>               <maven.compiler.target>1.8</maven.compiler.target>               <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>           </properties>       </profile>  </profiles></settings>

验证

$ . ~/.profile$ mvn -vApache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T03:39:06+08:00)Maven home: /home/aidan/dev/Maven/apache-maven-3.5.0Java version: 1.8.0_112, vendor: Oracle CorporationJava home: /home/aidan/dev/Java/jdk1.8.0_112/jreDefault locale: zh_CN, platform encoding: UTF-8OS name: "linux", version: "4.9.0-deepin9-amd64", arch: "amd64", family: "unix"
原创粉丝点击