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>
相关推荐
Wyc7240915 小时前
Maven
java·数据库·maven
逆风局?18 小时前
Maven高级——分模块设计与开发
java·maven
周某某~18 小时前
maven详解
java·maven
用户297994363791 天前
maven的安装和配置
maven
卡布叻_星星1 天前
后端 Maven打包 JAR 文件、前端打包dist文件、通过后端服务访问前端页面、Nginx安装与部署
前端·maven·jar
佛祖保佑永不宕机2 天前
maven引入本地jar包
java·maven·jar
Apex Predator2 天前
windows安装maven环境
java·maven
秉承初心2 天前
将Maven依赖上传到Gitee Packages并让他人引用方案(AI)
java·gitee·maven
hqxstudying3 天前
Intellij IDEA中Maven的使用
java·maven·intellij-idea
平平无奇程序员3 天前
Windows 下 Maven 安装与配置完全指南
maven