maven中的conf文件夹下的settings.xml文件配置


一、配置本地仓库

<!--设置本地仓库路径-->
<localRepository>D:\java\maven\localRepository</localRepository>

二、配置阿里云私服(或换成自己公司搭建的私服)

<!-- 在mirrors标签里添加mirror标签,并指定阿里云私服下载依赖会快点 -->
<mirror>
  <id>alimaven</id>
  <name>aliyun maven</name>
  <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
  <mirrorOf>central</mirrorOf>
</mirror>

三、配置maven默认jdk版本

<!-- 在已有的profiles标签中添加profile标签,限定maven项目默认的jdk版本 -->
<profile>    
    <id>myjdk</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>

<!-- 让增加的 profile生效 -->
<activeProfiles>
  <activeProfile>myjdk</activeProfile>
</activeProfiles>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM