maven 使用常见错误

一:部署报错 clean deploy

1:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) 

on project tc-rce-var-api: Failed to deploy artifacts: Could not transfer artifact com.tc:tc-rce-var-api:jar:1.0-20171128.062015-19 from/to 
snapshot (http://192.168.18.14:8080/nexus/content/repositories/snapshots): Access denied to http://192.168.18.14:8080/nexus/content/repositories/snapshots/com/tc/tc-rce-var-api/1.0-SNAPSHOT/tc-rce-var-api-1.0-20171128.062015-19.jar. Error code 401, Unauthorized -> [Help 1]

解决方式:

1:检查eclipse中的:maven installations和Use interface 的配置是否完整,可能是换了工作空间,忘记配置这个了

2:需要检查pom配置文件的

<distributionManagement>
<repository>
<id>release</id>
<name>Release Repository</name>
<url>http://192.168.18.177:8080/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>snapshot</id>
<name>Snapshot Repository</name>
<url>http://192.168.18.177:8080/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
<id>nexus-repos</id>
<name>Team Nexus Repository</name>
<url>http://192.168.18.177:8080/nexus/content/groups/public</url>
</repository>
<repository>
<id>nexus-repos-thirdparty</id>
<name>Team Nexus Repository thirdparty</name>
<url>http://192.168.18.177:8080/nexus/content/repositories/thirdparty</url>
</repository>
<repository>
<id>snapshot</id>
<name>Snapshot Repository</name>
<url>http://192.168.18.177:8080/nexus/content/repositories/snapshots</url>
</repository>
</repositories>

3:有的时候执行 clean package的时候也执行不了,可以执行

maven  > update maven project > force update of Snapshots/Releases

mvn clean -Dmaven.test.skip=true
mvn eclipse:eclipse


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值