使用Maven的jaxws wsgen插件时命令行参数太长,因为类路径很长

时间:2014-02-06 13:15:38

标签: command-line classpath maven-3 wsgen

我正在尝试使用org.jvnet.jax-ws-commons jaxws-maven-pluginwsgen目标生成Web服务工件。似乎该过程的一部分是执行包含类路径上所有项目jar的命令,这导致命令超过命令行的字符限制两倍以上(在Windows 7上)。我该如何解决这个问题?

[INFO] --- jaxws-maven-plugin:2.3:wsgen (generate-wsdl) @ interface ---
[INFO] Processing: com.mycompany.myproject.MyWebService
[INFO] jaxws:wsgen args: [-keep, -s, D:\Dev\myproject\target\generated-sources\wsgen, -d, D:\Dev\myproject\target\classes, -encoding, Cp1252, com.mycompany.myproject.MyWebService]
[WARNING] Length of the command is limitted to 8191 characters but it has 15450 characters.
[WARNING] cmd.exe /X /C "D:\java\jdk1.6.0_26\jre\bin\java.exe 

-Xbootclasspath/p:
D:\m2repo\javax\annotation\javax.annotation-api\1.2-b03\javax.annotation-api-1.2-b03.jar;
D:\m2repo\javax\jws\jsr181-api\1.0-MR1\jsr181-api-1.0-MR1.jar;
D:\m2repo\javax\xml\ws\jaxws-api\2.2.9\jaxws-api-2.2.9.jar;
D:\m2repo\javax\xml\soap\saaj-api\1.3.4\saaj-api-1.3.4.jar;
D:\m2repo\javax\xml\bind\jaxb-api\2.2.7\jaxb-api-2.2.7.jar 

-cp 
/D:/m2repo/org/jvnet/jax-ws-commons/jaxws-maven-plugin/2.3/jaxws-maven-plugin-2.3.jar org.jvnet.jax_ws_commons.jaxws.Invoker com.sun.tools.ws.wscompile.WsgenTool 

-pathfile 
C:\Users\me\AppData\Local\Temp\jax-ws-mvn-plugin-cp83681795198066117.txt 

-cp 
<long list of project jars from .m2 repository>

-keep 
-s D:\Dev\project\target\generated-sources\wsgen 
-d D:\Dev\project\target\classes 
-encoding Cp1252 

com.mycompany.myproject.MyWebService"

The command line is too long.

2 个答案:

答案 0 :(得分:3)

这是一个已知错误(JAX-WS-COMMON-110),将在版本2.3.1中修复。

直到jaxws-maven-plugin 2.3.1正式发布,你可以从svn编译它。

svn checkout https://svn.java.net/svn/jax-ws-commons~svn/tags/jaxws-maven-plugin-2.3.1-b03
cd jaxws-maven-plugin-2.3.1-b03
mvn install

然后更新您的pom.xml以使用2.3.1-b03版本:

<plugin>
    <groupId>org.jvnet.jax-ws-commons</groupId>
    <artifactId>jaxws-maven-plugin</artifactId>
    <version>2.3.1-b03</version>
...
</plugin>

答案 1 :(得分:2)