1

The (legacy) project I'm working in, is big and has lots of dependencies, now I'm trying to update it to java 9

Build tools is maven and one of the targets uses org.apache.cxf:cxf-java2ws-plugin:3.2.5 to generate wsdl from java sources. Now java2ws fails (on windows 10) because "The command line is too long". On closer introspection I can see

Command line was: "C:\Program Files\java\jdk-9.0.1\bin\java.exe" --add-modules java.activation,java.xml.bind,java.xml.ws --add-exports=java.xml.bind/com.sun.xml.internal.bind.v2.runtime=ALL-UNNAMED --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED --add-exports=java.xml/com.sun.org.apache.xerces.internal.impl.xs=ALL-UNNAMED --add-exports=java.xml.bind/com.sun.xml.internal.bind.marshaller=ALL-UNNAMED --add-opens java.xml.ws/javax.xml.ws.wsaddressing=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED -DexitOnFinish=true -cp c:\y\org\apache\cxf\cxf-java2ws-plugin\3.2.5\cxf-java2ws-plugin-3.2.5.jar;LOTS-OF-JARS;

In fact the LOTS-OF-JARS above contains 220 jar-files thus exceeding maximum command line length. I've tried shortening it by giving explicit -Dmaven.repo.local=c:\y parameter without help. Also I've attempted to override the classpath by giving undocumented configuration to the cxf-java2ws-plugin, but that seems only to append to the classpath

Anyone has idea how to proceed? Thanks in advance

theNikki1
  • 151
  • 1
  • 6

2 Answers2

0

Looks like the only workaround is to modify your program according to this article.

You can use Windows PowerShell to execute your build. It doesn't have this limitation.

Amila
  • 5,195
  • 1
  • 27
  • 46
  • Sadly same happens on powershell as well (at least on my computer) – theNikki1 Aug 06 '18 at 13:33
  • Yep, same here. As far as I know, the limit is still around 8191 chars – Ph3n1x Aug 08 '18 at 11:57
  • I think that is the way the maven-surefire-plugin has taken (see here: https://stackoverflow.com/questions/22528099/the-command-line-is-too-long-when-running-maven-test#answer-22531303) Sadly, the cxf-java2ws-plugin does not offer such option, at least I could not find any. – Ph3n1x Aug 09 '18 at 13:20
0

This issue has been patched in cxf-java2ws v3.3.0 . So if you can upgrade your plugin , this issue can be resolved.

(Know, its an old thread., but this may help someone)

Tirumudi
  • 423
  • 1
  • 4
  • 18