You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by xa...@apache.org on 2008/02/13 20:23:58 UTC

svn commit: r627568 - /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java

Author: xavier
Date: Wed Feb 13 11:23:54 2008
New Revision: 627568

URL: http://svn.apache.org/viewvc?rev=627568&view=rev
Log:
throw ParseException instead of returning null when the parsed pom didn't contain the module revision id

Modified:
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java?rev=627568&r1=627567&r2=627568&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java Wed Feb 13 11:23:54 2008
@@ -507,10 +507,6 @@
         }
 
         public ModuleDescriptor getDescriptor() {
-            if (md.getModuleRevisionId() == null) {
-                return null;
-            }
-            
             return md;
         }
         
@@ -621,7 +617,13 @@
             ise.initCause(ex);
             throw ise;
         }
-        return parser.getDescriptor();
+        ModuleDescriptor md = parser.getDescriptor();
+        if (md.getModuleRevisionId() == null) {
+            throw new ParseException("invalid pom " + res 
+                + ": no module revision id found. "
+                + "Check that this pom has a groupId, artifactId and version.", 0);
+        }
+        return md;
     }
 
     public void toIvyFile(InputStream is, Resource res, File destFile, ModuleDescriptor md)