开发者社区> 问答> 正文

Maven 执行 mvn clean package 失败?报错

Results :

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

[INFO] 
[INFO] --- maven-war-plugin:2.2:war (default-war) @ emsc ---
[INFO] Packaging webapp
[INFO] Assembling webapp [emsc] in [D:\workspaceREST\emsc\target\emsc]
[INFO] Processing war project
[INFO] Copying webapp resources [D:\workspaceREST\emsc\src\main\webapp]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.780 s
[INFO] Finished at: 2015-07-10T19:17:05+08:00
[INFO] Final Memory: 25M/108M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project emsc: Failed to copy file for artifact [javax.annotation:javax.annotation-api🏺1.2:compile]: Failed to copy full contents from D:\workspaceMaven\javax\annotation\javax.annotation-api\1.2\javax.annotation-api-1.2.jar to D:\workspaceREST\emsc\target\emsc\WEB-INF\lib\javax.annotation-api-1.2.jar -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException



不知道问题出在哪里 ?pom.xml的内容一直没有修改过。突然就不能了。另外,其他机子是可以打包成功的。不明~求解

加 -X 参数,详细的报错如下:

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war
 (default-war) on project emsc: Failed to copy file for artifact [javax.annotati
on:javax.annotation-api🏺1.2:compile]: Failed to copy full contents from D:\w
orkspaceMaven\javax\annotation\javax.annotation-api\1.2\javax.annotation-api-1.2
.jar to D:\workspaceREST\emsc\target\emsc\WEB-INF\lib\javax.annotation-api-1.2.j
ar -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project emsc:
Failed to copy file for artifact [javax.annotation:javax.annotation-api🏺1.2:
compile]
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:216)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThre
adedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:120)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to copy file f
or artifact [javax.annotation:javax.annotation-api🏺1.2:compile]
        at org.apache.maven.plugin.war.packaging.ArtifactsPackagingTask.performP
ackaging(ArtifactsPackagingTask.java:131)
        at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.handleA
rtifacts(WarProjectPackagingTask.java:190)
        at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.perform
Packaging(WarProjectPackagingTask.java:109)
        at org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(AbstractWarMo
jo.java:472)
        at org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(Abstr
actWarMojo.java:404)
        at org.apache.maven.plugin.war.WarMojo.performPackaging(WarMojo.java:215
)
        at org.apache.maven.plugin.war.WarMojo.execute(WarMojo.java:177)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:132)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:208)
        ... 19 more
Caused by: java.io.IOException: Failed to copy full contents from D:\workspaceMa
ven\javax\annotation\javax.annotation-api\1.2\javax.annotation-api-1.2.jar to D:
\workspaceREST\emsc\target\emsc\WEB-INF\lib\javax.annotation-api-1.2.jar
        at org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:1053)
        at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask.copyFi
le(AbstractWarPackagingTask.java:293)
        at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask$1.regi
stered(AbstractWarPackagingTask.java:150)
        at org.apache.maven.plugin.war.util.WebappStructure.registerFile(WebappS
tructure.java:211)
        at org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask.copyFi
le(AbstractWarPackagingTask.java:145)
        at org.apache.maven.plugin.war.packaging.ArtifactsPackagingTask.performP
ackaging(ArtifactsPackagingTask.java:106)
        ... 27 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
<p>
	<br>
</p>
<p>
	<br>
</p>

展开
收起
爱吃鱼的程序员 2020-06-14 14:41:46 2680 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    解决!
    删了本地的Maven 库,而后再重新下载 Maven 库里面的jar包,后就正常了。
    应该是 Maven 库里面的jar冲突了。

    不是提示:Re-runMavenusingthe-Xswitchtoenablefulldebuglogging. 。。加上个-X参数。输出详细的log吗?。。通常输出了log之后,一看就明白的了。
    已贴详情。望把脉

    2020-06-14 14:42:01
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Build Your Next ApacheSparkJob 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载