ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xav...@apache.org
Subject svn commit: r627568 - /ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorParser.java
Date Wed, 13 Feb 2008 19:23:58 GMT
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)



Mime
View raw message