maven Failed to copy file for artifact

 

hile building project: maven install,maven package,maven war:inplace

在做项目过程中经常出现类似以下的错误,记下来备忘。

 

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - com.taobao.lifeuser:lifeuser-server:war:1.0.0-SNAPSHOT
[INFO] 
[INFO] Id: com.taobao.lifeuser:lifeuser-server:war:1.0.0-SNAPSHOT
[INFO] task-segment: [package]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] No sources to compile
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test]
[INFO] Surefire report directory: E:\dev\workspace\lifeuser\lifeuser-server\target\surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
There are no tests to run.

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] [war:war]
[INFO] Packaging webapp
[INFO] Assembling webapp[lifeuser-server] in [E:\dev\workspace\lifeuser\lifeuser-server\target\lifeuser-server-1.0.0-SNAPSHOT]
[INFO] Processing war project
[ERROR] 

The following mojo encountered an error while executing:
Group-Id: org.apache.maven.plugins
Artifact-Id: maven-war-plugin
Version: 2.1-alpha-1
Mojo: war
brought in via: packaging: war

While building project:
Group-Id: com.taobao.lifeuser
Artifact-Id: lifeuser-server
Version: 1.0.0-SNAPSHOT
From file: E:\dev\workspace\lifeuser\lifeuser-server\pom.xml
Reason: Failed to copy file for artifact[com.taobao.lifeuser:lifeuser-core:jar:1.0.0-SNAPSHOT:compile]



[INFO] ------------------------------------------------------------------------
[INFO] For more information, run with the -e flag
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILED
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Thu Dec 22 14:22:50 CST 2011
[INFO] Final Memory: 2M/10M
[INFO] ------------------------------------------------------------------------

 

    Reason: Failed to copy file for artifact[com.taobao.lifeuser:lifeuser-core:jar:1.0.0-SNAPSHOT:compile]

 

    错误原因:需要操作本次仓库中lifeuser-core.jar这个包,而在本地的workspace已经有一个lifeuser-core工程,此工程中也有一份lifeuser-core.jar包,导致出错.

 

    解决方案:先将lifeuser-core这工程关掉,然后再去maven war:inplace(install、package),就不会有问题了。

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值