Author: jim.ma
Date: 2013-04-09 00:58:55 -0400 (Tue, 09 Apr 2013)
New Revision: 17483
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFConsumerImpl.java
stack/cxf/trunk/pom.xml
Log:
[JBWS-3138]:Pass the -clientjar option to cxf's wsdl2java tool
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFConsumerImpl.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFConsumerImpl.java 2013-04-09
04:51:41 UTC (rev 17482)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/tools/CXFConsumerImpl.java 2013-04-09
04:58:55 UTC (rev 17483)
@@ -24,6 +24,10 @@
import static org.jboss.wsf.stack.cxf.Messages.MESSAGES;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -48,6 +52,7 @@
import org.apache.cxf.common.util.Compiler;
import org.apache.cxf.helpers.FileUtils;
+import org.apache.cxf.helpers.IOUtils;
import org.apache.cxf.tools.common.ToolConstants;
import org.apache.cxf.tools.common.ToolContext;
import org.apache.cxf.tools.wsdlto.WSDLToJava;
@@ -65,6 +70,7 @@
{
private List<File> bindingFiles = null;
private File catalog = null;
+ private File clientJar = null;
private boolean extension;
private boolean generateSource = false;
private File outputDir = new File("output");
@@ -154,6 +160,14 @@
{
this.nocompile = nocompile;
}
+
+
+ @Override
+ public void setClientJar(File clientJar)
+ {
+ this.clientJar = clientJar;
+
+ }
@Override
public void consume(URL wsdl)
@@ -197,6 +211,12 @@
args.add("-catalog");
args.add(catalog.getAbsolutePath());
}
+
+ if (clientJar != null)
+ {
+ args.add("-clientjar");
+ args.add(clientJar.getName());
+ }
if (!nocompile)
{
@@ -294,14 +314,43 @@
}
finally
{
+ //hack to copy the clientjar file to outputdir
if (sourceTempDir != null)
{
+ for (File file : sourceTempDir.listFiles(new FilenameFilter() {
+ public boolean accept(File dir, String name)
+ {
+ if (!name.endsWith(".java"))
+ {
+ return true;
+ }
+ return false;
+ }
+ }))
+ {
+
+ InputStream input;
+ OutputStream output;
+ try
+ {
+ input = new FileInputStream(file);
+ output = new FileOutputStream(new File(outputDir, file.getName()));
+ IOUtils.copy(input, output);
+ }
+ catch (FileNotFoundException e)
+ {
+ //NOOP
+ }
+ catch (IOException e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ }
FileUtils.removeDir(sourceTempDir);
}
}
}
-
-
/**
* A CXF Compiler that installs a custom JavaFileManager to load JAXWS and JAXB apis
from
* the proper JBoss module (the one providing the JAXWS SPI Provider) instead of from
the
@@ -443,5 +492,4 @@
throw new RuntimeException(e);
}
}
-
}
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2013-04-09 04:51:41 UTC (rev 17482)
+++ stack/cxf/trunk/pom.xml 2013-04-09 04:58:55 UTC (rev 17483)
@@ -62,7 +62,7 @@
<jbossws.api.version>1.0.2-SNAPSHOT</jbossws.api.version>
<jbossws.spi.version>2.2.0-SNAPSHOT</jbossws.spi.version>
<jbossws.common.version>2.2.0-SNAPSHOT</jbossws.common.version>
- <jbossws.common.tools.version>1.1.0.Final</jbossws.common.tools.version>
+
<jbossws.common.tools.version>1.2.0-SNAPSHOT</jbossws.common.tools.version>
<jbossws.shared.testsuite.version>4.2.0-SNAPSHOT</jbossws.shared.testsuite.version>
<jbossws.jboss712.version>4.2.0-SNAPSHOT</jbossws.jboss712.version>
<jbossws.jboss713.version>4.2.0-SNAPSHOT</jbossws.jboss713.version>