2
回答
Maven 执行 mvn clean package 失败
终于搞明白,存储TCO原来是这样算的>>>   
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:jar: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:jar: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:jar: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:jar: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



举报
waylau
发帖于2年前 2回/7K+阅
顶部