2011-09-07 101 views
3

我正在執行一個行家當下面的錯誤之後MojoExecutor.execute例外從蝕安裝,這當我手動執行它(在命令行,而無需使用蝕)獲取積分積分行家和eclipse

我沒有得到
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project pconIvr: Compilation failure 
[ERROR] \PCX\PCX\release\pcx\core\pconIvr\src\main\java\com\anexsys\epay\ivr\IvrHostServlet.java:[355,48] cannot find symbol 
[ERROR] symbol : method extractContentAsDocument() 
[ERROR] location: interface javax.xml.soap.SOAPBody 
[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 pconIvr: Compilation failure 
\PCX\PCX\release\pcx\core\pconIvr\src\main\java\com\anexsys\epay\ivr\IvrHostServlet.java:[355,48] cannot find symbol 
symbol : method extractContentAsDocument() 
location: interface javax.xml.soap.SOAPBody 

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:319) 
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) 
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534) 
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:39) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:585) 
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 

回答

0

就是Eclipse設置爲使用相同的JDK的命令行?您可以通過查看控制檯的頂部(它將有通往java可執行文件的路徑)來檢查前者,後者使用java -version

如果你堅持使用java 1.5(這是非常古老的,並且最新版本更新22),不要嘗試使用v1.6 extractContentAsDocument方法,因爲它不會編譯。

+0

兩者都使用相同的JDK ....................... Eclipse - C:\ Program Files \ Java \ jdk1.5.0_11 \ bin \ javaw.exe ................................... 控制檯o/p - C: Java™版本 Java版本「1.5.0_11」 Java(TM)2運行環境標準版(內部版本1.5.0_11-b03) Java HotSpot™客戶端VM(版本1.5.0_11-b03,混合模式,共享) – sivakumar

+0

'javax.xml.soap.SOAPBody.extractContentAsDocument'僅在Java 1.6中,所以兩者都應該失敗。我會再次檢查您的Eclipse是否按照您的預期使用1.5。您的POM是否具有編譯器版本集? – artbristol

+0

是的.. 1.5 '' 1.5'' – sivakumar

1

我有同樣的問題。我注意到,在我的POM文件版本設置爲3.0。

<groupId>org.apache.maven.plugins</groupId> 
<artifactId>maven-compiler-plugin</artifactId> 
<version>2.0</version> 

我把它改回2.0,一切開始編譯。