Maven:将结果安装到编译失败

时间:2014-04-21 13:09:42

标签: java maven

当运行命令" mvn clean"时,它返回构建成功但是当运行" mvn install"时,它返回编译失败。你能帮我找出导致错误的原因吗?提前谢谢。

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.725s
[INFO] Finished at: Mon Apr 21 17:50:15 IST 2014
[INFO] Final Memory: 27M/270M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project Sample: Compilation failure
[ERROR] \Sample\sample\src\main\java\com\sample\services\tests\CuteIntegrationService.java:[51,73] error: cannot access TransformerObjectSupport
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project sample: Compilation failure
\Sample\sample\\src\main\java\com\sample\services\tests\CuteIntegrationService.java:[51,73] error: cannot access TransformerObjectSupport

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    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.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
\sample_codeFromGit\sample\src\main\java\com\sample\services\tests\CuteIntegrationService.java:[51,73] error: cannot access TransformerObjectSupport

    at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:656)
    at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
    ... 19 more
[ERROR] 
[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/MojoFailureException

我正在使用eclipse juno IDe,maven3.2.1和jdk 1.7

2 个答案:

答案 0 :(得分:3)

  • clean目标仅删除目标文件夹内容。因此没有错误。

  • 尝试dependency:resolve单独加载依赖项。

它应该在编译阶段之前自动下载依赖项。

  • 验证POM的编译时间依赖性。如果这不起作用,请在此处发布您的POM文件。

答案 1 :(得分:1)

Maven必须下载包含TransformerObjectSupport类的jar。

可能是spring-ws-core - * .jar,请在.m2e文件夹中查看

还要检查pom.xml中的依赖项