Author: asoldano
Date: 2014-09-11 10:56:52 -0400 (Thu, 11 Sep 2014)
New Revision: 18928
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsConsumeMojo.java
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractConsumerParams.java
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractDelegate.java
Log:
[JBWS-3828] Adding encoding support to the plugin
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsConsumeMojo.java
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsConsumeMojo.java 2014-09-11
14:56:13 UTC (rev 18927)
+++
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/AbstractWsConsumeMojo.java 2014-09-11
14:56:52 UTC (rev 18928)
@@ -94,6 +94,13 @@
private String wsdlLocation;
/**
+ * Sets the charset encoding to be used for generated files.
+ *
+ * @parameter default-value="${project.build.sourceEncoding}"
+ */
+ protected String encoding;
+
+ /**
* Set the target JAX-WS specification target. Defaults to
<code>2.0</code>. Allowed values are <code>2.0</code>,
<code>2.1</code>
*
* @parameter
@@ -138,6 +145,7 @@
params.setTarget(target);
params.setTargetPackage(targetPackage);
params.setWsdlLocation(wsdlLocation);
+ params.setEncoding(encoding);
params.setArgLine(argLine);
params.setFork(fork);
WSContractDelegate delegate = new WSContractDelegate(getLog());
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractConsumerParams.java
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractConsumerParams.java 2014-09-11
14:56:13 UTC (rev 18927)
+++
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractConsumerParams.java 2014-09-11
14:56:52 UTC (rev 18928)
@@ -41,6 +41,7 @@
private String target;
private String targetPackage;
private String wsdlLocation;
+ private String encoding;
private String argLine;
public boolean isAdditionalHeaders()
@@ -131,6 +132,14 @@
{
this.wsdlLocation = wsdlLocation;
}
+ public String getEncoding()
+ {
+ return encoding;
+ }
+ public void setEncoding(String encoding)
+ {
+ this.encoding = encoding;
+ }
public boolean isExtension()
{
return extension;
Modified:
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractDelegate.java
===================================================================
---
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractDelegate.java 2014-09-11
14:56:13 UTC (rev 18927)
+++
projects/plugins/maven/jaxws-tools/trunk/src/main/java/org/jboss/ws/plugins/tools/WSContractDelegate.java 2014-09-11
14:56:52 UTC (rev 18928)
@@ -192,6 +192,11 @@
commandList.add("-w");
commandList.add(params.getWsdlLocation());
}
+ if (params.getEncoding() != null)
+ {
+ commandList.add("-d");
+ commandList.add(params.getEncoding());
+ }
if (params.getOutputDirectory() != null)
{
commandList.add("-o");
@@ -315,6 +320,10 @@
{
callMethod(consumerClass, consumer, "setWsdlLocation",
params.getWsdlLocation());
}
+ if (params.getEncoding() != null)
+ {
+ callMethod(consumerClass, consumer, "setEncoding",
params.getEncoding());
+ }
}
private static Object callMethod(Class<?> clazz, Object obj, String name,
boolean param) throws Exception
Show replies by date