cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [1/4] cxf-xjc-utils git commit: Throw an exception when a dependency fails to resolve
Date Wed, 08 Jul 2015 20:42:41 GMT
Repository: cxf-xjc-utils
Updated Branches:
  refs/heads/master ad38d5a3b -> 92ab73fd7


Throw an exception when a dependency fails to resolve


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/6c7770cc
Tree: http://git-wip-us.apache.org/repos/asf/cxf-xjc-utils/tree/6c7770cc
Diff: http://git-wip-us.apache.org/repos/asf/cxf-xjc-utils/diff/6c7770cc

Branch: refs/heads/master
Commit: 6c7770ccca2ccfaa752d469ae69252f57106f6d9
Parents: 48db284
Author: Hugo Trippaers <hugo@apache.org>
Authored: Thu Apr 16 09:41:50 2015 +0200
Committer: Hugo Trippaers <htrippaers@schubergphilis.com>
Committed: Thu Apr 16 10:39:11 2015 +0200

----------------------------------------------------------------------
 .../org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java    | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-xjc-utils/blob/6c7770cc/cxf-xjc-plugin/src/main/java/org/apache/cxf/maven_plugin/AbstractXSDToJavaMojo.java
----------------------------------------------------------------------
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 371bc22..9947e2b 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
@@ -258,7 +258,7 @@ public abstract class AbstractXSDToJavaMojo extends AbstractMojo {
         }
     }
     
-    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";
@@ -281,7 +281,10 @@ public abstract class AbstractXSDToJavaMojo extends AbstractMojo {
         ArtifactResolutionResult result = repository.resolve(request);
         List<File> files = new ArrayList<File>();
         for (Artifact a : result.getArtifacts()) {
-            files.add(a.getFile());
+            if (a.getFile() == null) {
+                throw new MojoExecutionException("Unable to resolve " + a.toString()
+                        + " while resolving " + artifactDescriptor);
+            }
         }
         if (!files.contains(artifact.getFile())) {
             files.add(artifact.getFile());


Mime
View raw message