cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [4/4] cxf-xjc-utils git commit: Merge branch 'master' of https://github.com/mbert/cxf-xjc-utils This closes #2
Date Wed, 08 Jul 2015 20:42:44 GMT
Merge branch 'master' of https://github.com/mbert/cxf-xjc-utils
This closes #2


Project: http://git-wip-us.apache.org/repos/asf/cxf-xjc-utils/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-xjc-utils/commit/92ab73fd
Tree: http://git-wip-us.apache.org/repos/asf/cxf-xjc-utils/tree/92ab73fd
Diff: http://git-wip-us.apache.org/repos/asf/cxf-xjc-utils/diff/92ab73fd

Branch: refs/heads/master
Commit: 92ab73fd7642b221d01129a26cb9e2206062ef2c
Parents: ef81073 fb0162e
Author: Daniel Kulp <dkulp@apache.org>
Authored: Wed Jul 8 15:57:09 2015 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Wed Jul 8 15:57:21 2015 -0400

----------------------------------------------------------------------
 .../cxf/maven_plugin/AbstractXSDToJavaMojo.java | 187 +++++++++++--------
 .../org/apache/cxf/maven_plugin/XsdOption.java  |   7 +
 2 files changed, 118 insertions(+), 76 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-xjc-utils/blob/92ab73fd/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java
----------------------------------------------------------------------
diff --cc cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java
index 5a69545,dfbe3c4..8d4a087
--- 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
@@@ -258,7 -262,34 +262,34 @@@ public abstract class AbstractXSDToJava
          }
      }
      
+     private String[] getXsdFiles(String xsdDir, String xsd) throws MojoExecutionException
{
+         final String[] xsdFiles;
+         if (xsdDir != null && !xsdDir.isEmpty()) {
+             File dir = new File(xsdDir);
+             if (!dir.isDirectory()) {
+                 throw new MojoExecutionException("Error, xsdDir \"" + xsdDir + "\" does
not exist.");
+             }  
+             String[] fileList = dir.list(new FilenameFilter() {
+                 @Override
+                 public boolean accept(File dir, String name) {
+                     return name.endsWith(".xsd");
+                 }
+             });
+             if (fileList == null || fileList.length == 0) {
+                 throw new MojoExecutionException("Error, xsdDir \"" + xsdDir + "\" does
not contain any *.xsd files.");
+             }
+             xsdFiles = new String[fileList.length];
+             for (int i = 0; i < fileList.length; ++i) {
+                 xsdFiles[i] = xsdDir + (xsdDir.endsWith(File.separator) ? "" : File.separator)
+ fileList[i];
+             }
+         } else {
+             xsdFiles = new String[1];
+             xsdFiles[0] = xsd;
+         }
+         return xsdFiles;
+     }
+     
 -    private List<File> resolve(String artifactDescriptor) {
 +    private List<File> resolve(String artifactDescriptor) throws MojoExecutionException
{
          String[] s = artifactDescriptor.split(":");
  
          String type = s.length >= 4 ? s[3] : "jar";


Mime
View raw message