maven项目打包遇到问题,如何处理?
maven项目默认使用国外源,打包速度过慢,包下载不了;
将maven项目设置为国内源可解决问题:
- 在pom.xml中设置,仅在当前项目中起作用
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>ManagePlayer</artifactId>
<version>1.0-SNAPSHOT</version>
</project>
- 通过setting.xml文件设置,所有项目中都起作用
2.
3. 如果相应的路径下没有setting.xml文件,设置setting.xml文件;如果有的话,检查setting.xml文件中是否有 阿里云的镜像
实在不行,就把原来的删了,重新设置一个
setting.xml文件
<?xml version="1.0" encoding="UTF-8"?>
-<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/SETTINGS/1.0.0">
-<pluginGroups>
</pluginGroups>
-<proxies>
</proxies>
-<servers>
</servers>
-<mirrors>
-<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
-<profiles>
</profiles>
</settings>
- 勾选override
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)