maven环境搭建

maven历史版本下载:https://archive.apache.org/dist/maven/

  • 新建系统变量
  • 编辑Path,添加bin目录
  • mvn -v测试查看版本号
  • conf目录下新建repository文件夹,作为本地仓库

settings.xml

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">
  
  <!--设置本地仓库位置-->
   <localRepository>D:\apache-maven-3.6.1\conf\repository</localRepository>
  
  <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>
	<mirror>
	    <id>alimaven</id>
	    <name>aliyun maven</name>
	    <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
	    <mirrorOf>central</mirrorOf>
	</mirror>
	<!--maven镜像-->
	<mirror>
	    <id>central</id>
	    <name>Maven Repository Switchboard</name>
	    <url>http://repo1.maven.org/maven2/</url>
	    <mirrorOf>central</mirrorOf>
	</mirror>
	<mirror>
	    <id>repo2</id>
	    <mirrorOf>central</mirrorOf>
	    <name>Human Readable Name for this Mirror.</name>
	    <url>http://repo2.maven.org/maven2/</url>
	</mirror>
	<!-- 中央仓库在中国的镜像 -->
	<mirror>
	    <id>maven.net.cn</id>
	    <name>oneof the central mirrors in china</name>
	    <url>http://maven.net.cn/content/groups/public/</url>
	    <mirrorOf>central</mirrorOf>
	</mirror>
	<!--ibiblio镜像-->
	<mirror>
	    <id>ibiblio</id>
	    <mirrorOf>central</mirrorOf>
	    <name>Human Readable Name for this Mirror.</name>
	    <url>http://mirrors.ibiblio.org/pub/mirrors/maven2/</url>
	</mirror>
	<!--Jboss镜像-->
	<mirror>
	    <id>jboss-public-repository-group</id>
	    <mirrorOf>central</mirrorOf>
	    <name>JBoss Public Repository Group</name>
	    <url>http://repository.jboss.org/nexus/content/groups/public</url>
	</mirror>
	<!--google镜像-->
	<mirror>
	    <id>google-maven-central</id>
	    <name>Google Maven Central</name>
	    <url>https://maven-central.storage.googleapis.com
	    </url>
	    <mirrorOf>central</mirrorOf>
	</mirror>
  </mirrors>
  
  <profiles>
  	<!--指定jdk的版本-->
    <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>
相关推荐
MaCa .BaKa1 小时前
38-日语学习小程序
java·vue.js·spring boot·学习·mysql·小程序·maven
贺函不是涵2 小时前
【沉浸式求职学习day41】【Servlet】
java·学习·servlet·maven
新时代丘鸣山8 小时前
idea Maven 打包SpringBoot可执行的jar包
maven·intellij-idea·jar
帮帮志10 小时前
idea整合maven环境配置
java·maven·intellij-idea
2401_cf16 小时前
如何创建maven项目
java·maven·intellij-idea
伍六星1 天前
maven和npm区别是什么
java·npm·maven
长征coder1 天前
Maven Deploy的依赖与引用方的依赖不同
java·maven
不知几秋2 天前
Maven
java·数据库·maven
下雨天u2 天前
maven dependencyManagement标签作用
java·数据库·maven
码农飞哥2 天前
互联网大厂Java求职面试实战:Spring Boot到微服务全景解析
java·spring boot·微服务·maven·hibernate·技术栈·面试技巧