win10中安装maven

下载安装

下载地址

https://maven.apache.org/download.cgi

下载 apache-maven-xxx-bin.zip 后放入到某文件夹中并且进行解压

修改环境变量

右击我的电脑->属性->高级系统设置->环境变量

添加系统变量

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-qBucacXp-1643183376286)(C:\Users\38117\AppData\Roaming\Typora\typora-user-images\image-20220126154231267.png)]

M2_HOME
D:\app\others\maven-3.8.4

添加path

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-uZuTnRfc-1643183376287)(C:\Users\38117\AppData\Roaming\Typora\typora-user-images\image-20220126154528829.png)]

%M2_HOME%\bin

测试

# cmd 输入
mvn -v

出现版本号则证明配置成功

Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: D:\app\others\maven-3.8.4
Java version: 1.8.0_321, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jre1.8.0_321
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

配置settings

打开文件D:\app\others\maven-3.8.4\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">

	<localRepository>D:\data\appData\maven\repository-2022-01-26</localRepository>

  <pluginGroups>
 
	<pluginGroup>org.apache.tomcat.maven</pluginGroup>
  </pluginGroups>

  <proxies>

  </proxies>

  <servers>

	<server>
        <id>releases</id>
        <username>ali</username>
        <password>ali</password>
      </server>
      <server>
        <id>Snapshots</id>
        <username>ali</username>
        <password>ali</password>
      </server>
  </servers>


  <mirrors>

	 <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>        
    </mirror>
	<mirror>
      <id>alimaven-public-snapshots</id>
      <mirrorOf>public-snapshots</mirrorOf> 
      <url>http://maven.aliyun.com/nexus/content/repositories/snapshots/</url>
    </mirror>
	<mirror>
        <id>springframework</id>
        <mirrorOf>central</mirrorOf>
        <name>springframework</name>
        <url>http://maven.springframework.org/release/</url>
    </mirror>
	<mirror>
      <id>mvn</id>
      <mirrorOf>central</mirrorOf>
      <name>mavenRepository</name>
      <url>http://insecure.repo1.maven.org/maven2/</url>
	</mirror>
	<!-- 中央仓库1 -->
	<mirror>
		<id>repo1</id>
		<mirrorOf>central</mirrorOf>
		<name>wso2</name>
		<url>maven.wso2.org/nexus/content/groups/public/</url>
	</mirror>
	<!-- 中央仓库2 -->
	<mirror>
		<id>repo2</id>
		<mirrorOf>central</mirrorOf>
		<name>tmatesoft</name>
		<url>http://maven.tmatesoft.com/content/groups/public/</url>
	</mirror>
	<mirror>
        <id>nexus-apache</id>
        <mirrorOf>central</mirrorOf>
        <name>Nexus apache</name>
        <url>http://central.maven.org/maven2/</url>
    </mirror>
  </mirrors>

 
  <profiles>
   
	<profile>
		<id>alimaven</id>
		<activation>
			<activeByDefault>true</activeByDefault>
		</activation>
		<repositories>
			<repository>
				<id>ali-maven</id>
				<name>ali-maven</name>
				<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
				<releases>
					<enabled>true</enabled>
				</releases>
				<snapshots>
					<enabled>false</enabled>
				</snapshots>
			</repository>
			<repository>
				<id>spring-maven</id>
				<name>spring-maven</name>
				<url>http://maven.springframework.org/release/</url>
				<releases>
					<enabled>true</enabled>
				</releases>
				<snapshots>
					<enabled>false</enabled>
				</snapshots>
			</repository>
			<repository>
				<id>nexus-apache</id>
				<name>Nexus apache</name>
				<url>http://central.maven.org/maven2/</url>
				<releases>
					<enabled>true</enabled>
				</releases>
				<snapshots>
					<enabled>false</enabled>
				</snapshots>
			</repository>
		</repositories>

		<pluginRepositories>
			<pluginRepository>
				<id>ali-maven</id>
				<name>ali-maven</name>
				<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
				<releases>
					<enabled>true</enabled>
				</releases>
				<snapshots>
					<enabled>false</enabled>
				</snapshots>
			</pluginRepository>
			<pluginRepository>
				<id>nexus-apache</id>
				<name>Nexus-apache</name>
				<url>http://central.maven.org/maven2/</url>
				<releases>
					<enabled>true</enabled>
				</releases>
				<snapshots>
					<enabled>false</enabled>
				</snapshots>
			</pluginRepository>
		</pluginRepositories>
	</profile>
  </profiles>

</settings>

<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</pluginRepository>
	</pluginRepositories>
</profile>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值