从昨天开始我就被这个问题困住了。我在 Windows 上使用 Maven 2:
Apache Maven 2.2.1 (r801777; 2009-08-06 20:16:01+0100)
在我的 POM 中,我使用插件jaxws-maven-plugin
如下:
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<configuration>
<wsdlFiles>
<wsdlFile>${basedir}/src/main/resources/MyService.wsdl
</wsdlFile>
</wsdlFiles>
<packageName>my.package.name</packageName>
</configuration>
</plugin>
当我运行时mvn compile
,出现以下错误:
[INFO] jaxws:wsimport args: [-keep, -s, D:\myService\target\generated-sources\wsimport, -Xnocompile, -p, my.service.name, file:/D:/myService/src/main/resources/MyService.wsdl]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error executing: wsimport [-keep, -s, D:\myService\target\generated-sources\wsimport, -Xnocompile, -p, my.service.name, file:/D:/myService/src/main/resources/MyService.wsdl]
Embedded error: com/sun/tools/xjc/api/ErrorListener
com.sun.tools.xjc.api.ErrorListener
我试过了 :
MAVEN_OPT
添加具有值的 Windows 环境变量-Xmx768M -Xms768M -XX:PermSize=256m
启动
wsimport
自己,它正在工作:wsimport -keep -s D:\myService\target\generated-sources\wsimport -Xnocompile -p my.service.name file:/D:/myService/src/main/resources/MyService.wsdl
所以任何人都知道这可能意味着什么:
Embedded error: com/sun/tools/xjc/api/ErrorListener
com.sun.tools.xjc.api.ErrorListener