You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2018/06/11 19:17:33 UTC

[cxf-xjc-utils] branch master updated (844eeb6 -> 689ca24)

This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/cxf-xjc-utils.git.


    from 844eeb6  Updating some plugins
     new 340fa3a  Update to latest PMD
     new 407e334  Add a test to see if we can compile UTF-8 char comments
     new 689ca24  [CXF-7755] Add an encoding option to xjc, default to project encoding

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 boolean-test/pom.xml                                       |  3 +--
 .../src/test/resources/schemas/configuration/foo.xsd       |  8 ++++++--
 .../org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java | 14 +++++++++++---
 .../java/org/apache/cxf/maven_plugin/XSDToJavaRunner.java  |  2 +-
 .../java/org/apache/cxf/xjc/javadoc/JavadocPluginTest.java |  6 ++----
 pom.xml                                                    |  2 +-
 6 files changed, 22 insertions(+), 13 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
dkulp@apache.org.

[cxf-xjc-utils] 03/03: [CXF-7755] Add an encoding option to xjc, default to project encoding

Posted by dk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf-xjc-utils.git

commit 689ca241576cc0680d6368041f2da7fee23fbb62
Author: Daniel Kulp <dk...@apache.org>
AuthorDate: Mon Jun 11 15:17:04 2018 -0400

    [CXF-7755] Add an encoding option to xjc, default to project encoding
---
 boolean-test/pom.xml                                           |  3 +--
 .../org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java     | 10 +++++++++-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/boolean-test/pom.xml b/boolean-test/pom.xml
index 6b9a003..cddfda1 100644
--- a/boolean-test/pom.xml
+++ b/boolean-test/pom.xml
@@ -30,8 +30,7 @@
 		<version>3.2.2-SNAPSHOT</version>
 	</parent>
 
-
-	<dependencies>
+    <dependencies>
 		<dependency>
 			<groupId>javax.xml.bind</groupId>
 			<artifactId>jaxb-api</artifactId>
diff --git a/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java b/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java
index f772153..75b580b 100644
--- a/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java
+++ b/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java
@@ -92,6 +92,12 @@ public abstract class AbstractXSDToJavaMojo extends AbstractMojo {
     private boolean fork;
     
     /**
+     * 
+     */
+    @Parameter(defaultValue = "${project.build.sourceEncoding}")
+    private String encoding;
+    
+    /**
      * Sets the Java executable to use when fork parameter is <code>true</code>.
      */
     @Parameter(defaultValue = "${java.home}/bin/java")
@@ -421,7 +427,9 @@ public abstract class AbstractXSDToJavaMojo extends AbstractMojo {
         if (getLog().isDebugEnabled()) {
             list.add("-verbose");            
         }
-
+        list.add("-encoding");
+        list.add(encoding);
+        
         String[] xsdFiles = getXsdFiles(option.getXsdDir(), option.getXsd());
         for (String xsdFile : xsdFiles) {
             list.add("-d");

-- 
To stop receiving notification emails like this one, please contact
dkulp@apache.org.

[cxf-xjc-utils] 01/03: Update to latest PMD

Posted by dk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf-xjc-utils.git

commit 340fa3af571b80923a5180655d996bdf14b02112
Author: Daniel Kulp <dk...@apache.org>
AuthorDate: Mon Jun 11 15:05:50 2018 -0400

    Update to latest PMD
---
 .../java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java     | 4 ++--
 .../src/main/java/org/apache/cxf/maven_plugin/XSDToJavaRunner.java  | 2 +-
 .../src/test/java/org/apache/cxf/xjc/javadoc/JavadocPluginTest.java | 6 ++----
 pom.xml                                                             | 2 +-
 4 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java b/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java
index 56fb83f..f772153 100644
--- a/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java
+++ b/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java
@@ -397,7 +397,7 @@ public abstract class AbstractXSDToJavaMojo extends AbstractMojo {
         }
         if (!newCp.isEmpty()) {
             Thread.currentThread()
-                .setContextClassLoader(new URLClassLoader(newCp.toArray(new URL[newCp.size()]),
+                .setContextClassLoader(new URLClassLoader(newCp.toArray(new URL[0]),
                                                           Thread.currentThread().getContextClassLoader()));
         }
         if (option.getPackagename() != null) {
@@ -429,7 +429,7 @@ public abstract class AbstractXSDToJavaMojo extends AbstractMojo {
             list.add(mapLocation(xsdFile).toString());
         }
 
-        return list.toArray(new String[list.size()]);
+        return list.toArray(new String[0]);
         
     }
     
diff --git a/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/XSDToJavaRunner.java b/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/XSDToJavaRunner.java
index 3df23e0..513dc79 100644
--- a/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/XSDToJavaRunner.java
+++ b/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/XSDToJavaRunner.java
@@ -114,7 +114,7 @@ public class XSDToJavaRunner {
             }
         }
 
-        final ClassLoader loader = new URLClassLoader(urls.toArray(new URL[urls.size()]), 
+        final ClassLoader loader = new URLClassLoader(urls.toArray(new URL[0]), 
                                                       this.getClass().getClassLoader());
         
         CatalogManager cm = new CatalogManager();
diff --git a/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocPluginTest.java b/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocPluginTest.java
index 101f668..6fa2ebf 100644
--- a/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocPluginTest.java
+++ b/javadoc/src/test/java/org/apache/cxf/xjc/javadoc/JavadocPluginTest.java
@@ -180,7 +180,7 @@ public class JavadocPluginTest extends Assert {
     }
 
     private int runXjc(List<String> args) throws Exception {
-        return Driver.run(args.toArray(new String[args.size()]), System.out, System.out);
+        return Driver.run(args.toArray(new String[0]), System.out, System.out);
     }
 
     private Javadoc getJavadocOfField(CompilationUnit compilationUnit, String fieldName) {
@@ -207,9 +207,7 @@ public class JavadocPluginTest extends Assert {
         JavaCore.setComplianceOptions(JavaCore.VERSION_1_5, options);
         parser.setCompilerOptions(options);
         parser.setSource(classChars);
-        CompilationUnit compilationUnit = (CompilationUnit)parser.createAST(null);
-        
-        return compilationUnit;
+        return (CompilationUnit)parser.createAST(null);
     }
 
     private FieldDeclaration findField(FieldDeclaration[] fields, String fieldName) {
diff --git a/pom.xml b/pom.xml
index 45c9044..5c759a8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -424,7 +424,7 @@
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-pmd-plugin</artifactId>
-                    <version>3.7</version>
+                    <version>3.10.0</version>
                     <dependencies>
                         <dependency>
                             <groupId>org.apache.cxf.build-utils</groupId>

-- 
To stop receiving notification emails like this one, please contact
dkulp@apache.org.

[cxf-xjc-utils] 02/03: Add a test to see if we can compile UTF-8 char comments

Posted by dk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

dkulp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf-xjc-utils.git

commit 407e334e5e5836d0b4921cf98bb3c744d96f6bc2
Author: Daniel Kulp <dk...@apache.org>
AuthorDate: Mon Jun 11 15:06:03 2018 -0400

    Add a test to see if we can compile UTF-8 char comments
---
 boolean-test/src/test/resources/schemas/configuration/foo.xsd | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/boolean-test/src/test/resources/schemas/configuration/foo.xsd b/boolean-test/src/test/resources/schemas/configuration/foo.xsd
index 64b12e6..c471786 100644
--- a/boolean-test/src/test/resources/schemas/configuration/foo.xsd
+++ b/boolean-test/src/test/resources/schemas/configuration/foo.xsd
@@ -48,8 +48,12 @@
     	</xs:sequence>
     </xs:complexType>
 
-    <xs:complexType name="foo">        
-        <xs:sequence>
+    <xs:complexType name="foo">   
+	    <xs:annotation>
+	      <xs:documentation>This is a test documentation with strange UTF chars:  Ã, Ã, ¢, â‚ €, für
+	      </xs:documentation>
+	    </xs:annotation>     
+	    <xs:sequence>
 	    <xs:element name="pageColor" type="tns:pageColor" minOccurs="0"></xs:element>
             <xs:element name="driving" type="tns:drivingDecision" default="LeftTurn" minOccurs="0"></xs:element>
             <xs:element name="stringElem" type="xs:string" default="hello" minOccurs="0"></xs:element>

-- 
To stop receiving notification emails like this one, please contact
dkulp@apache.org.