• centos下安装配置maven


    • 下载maven安装包
    wget http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
    • 解压安装包
    tar -xvf apache-maven-3.3.9-bin.tar.gz
    • 删除多余安装包 重命名
    rm -rf apache-maven-3.3.9-bin.tar.gz
    mv apache-maven-3.3.9/ maven-3.3


    • 配置maven环境
    vi /etc/profile
    
    
    # java
    export JAVA_HOME=/java/jdk-1.8
    export PATH=$JAVA_HOME/bin:$PATH
    export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
    
    # maven
    export MAVEN_HOME=/java/maven-3.3
    export PATH=$MAVEN_HOME/bin:$PATH
    

      

    • 使配置文件生效
    source /etc/profile

    • 查看maven版本
    mvn -v

    修改setting.xml文件

    在当前目录下的 maven-3.3/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>
            <!-- 配置jar包下载路径 linux需要更改为/目录开头的linux目录 -->
    	<localRepository>E:/java/repo</localRepository>
    
    
    
      <proxies>
      													
      </proxies>
    
    
      <servers>
       				
      </servers>
    
      <!-- 从阿里云镜像下载jar包 -->
      <mirrors>
    	<mirror>
          <id>alimaven</id>
          <name>aliyun maven</name>
          <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
          <mirrorOf>central</mirrorOf>        
        </mirror>
      </mirrors>
    
     <!-- 指定jdk1.8 -->
     <profiles>
    	<profile>	
    		<id>jdk1.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>

    来自  http://blog.youxiu326.com/view/5

  • 相关阅读:
    使用定时器实现获取手机验证码倒计时
    搜索历史管理
    利用vue和jQuery实现中国主要城市搜索与选择
    使用vue、jQuery生成带有logo的二维码
    使用vue-cli脚手架搭建Vue项目
    postcss-px-to-viewport
    git命令操作篇
    小程序中live-player
    对于常用数组的方法总结
    css的加载中动画
  • 原文地址:https://www.cnblogs.com/youxiu326/p/10540752.html
Copyright © 2020-2023  润新知