Maven修改settings.xml的配置

配置本地仓库

<localRepository>本地仓库的路径</localRepository>

配置JDK版本
在节点中添加(实例为添加JDK1.9的版本)

<profile>
		 <id>jdk-1.9</id>
		 <activation>
			<activeByDefault>true</activeByDefault>
			<jdk>1.9</jdk>
		 </activation>
		 <properties>
			  <maven.compiler.source>1.9</maven.compiler.source>
			  <maven.compiler.target>1.9</maven.compiler.target>
			  <maven.compiler.compilerVersion>1.9</maven.compiler.compilerVersion>
		  </properties>
</profile>

配置远程仓库为国内节点
在节点中添加(举例为阿里云远程仓库)

<mirror>
      <id>alimaven</id>
      <mirrorOf>central</mirrorOf>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
<mirror>
      <id>repo2</id>
      <mirrorOf>central</mirrorOf>
      <name>repo2 maven</name>
      <url>http://repo2.maven.org/maven2</url>
</mirror>

猜你喜欢

转载自blog.csdn.net/weixin_45355510/article/details/112102590
今日推荐