ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maart...@apache.org
Subject svn commit: r733946 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
Date Mon, 12 Jan 2009 22:37:57 GMT
Author: maartenc
Date: Mon Jan 12 14:37:56 2009
New Revision: 733946

URL: http://svn.apache.org/viewvc?rev=733946&view=rev
Log:
FIX: NullPointerException at PomModuleDescriptorBuilder.addDependency (IVY-995) (merged from
2.0.0 branch)

Modified:
    ant/ivy/core/trunk/   (props changed)
    ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java

Propchange: ant/ivy/core/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan 12 14:37:56 2009
@@ -1,4 +1,4 @@
-/ant/ivy/core/branches/2.0.0:727520-732105
+/ant/ivy/core/branches/2.0.0:727520-732483
 /ant/ivy/core/branches/2.0.0-rc2:707459-708717
 /ant/ivy/core/branches/2.0.x:696803-698317
 /ant/ivy/core/trunk:695737,696014-696031,696442

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java?rev=733946&r1=733945&r2=733946&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomModuleDescriptorBuilder.java
Mon Jan 12 14:37:56 2009
@@ -17,7 +17,6 @@
  */
 package org.apache.ivy.plugins.parser.m2;
 
-import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -270,14 +269,11 @@
         ivyModuleDescriptor.addArtifact("master", mainArtifact);
     }
 
-
-    public void addDependency(Resource res, PomDependencyData dep) throws ParseException
{
+    public void addDependency(Resource res, PomDependencyData dep) {
         String scope = dep.getScope();
         if ((scope != null) && (scope.length() > 0) && !MAVEN2_CONF_MAPPING.containsKey(scope))
{
-            String msg = "Unknown scope '" + scope + "' for dependency "
-                    + ModuleId.newInstance(dep.getGroupId(), dep.getArtifactId()) + " in
"
-                    + res.getName();
-            throw new ParseException(msg, 0);
+            // unknown scope, defaulting to 'compile'
+            scope = "compile";
         }
         
         String version = dep.getVersion();
@@ -408,7 +404,7 @@
     private String getDefaultScope(PomDependencyData dep) {
         String key = getDependencyMgtExtraInfoKeyForScope(dep.getGroupId(), dep.getArtifactId());
         String result = (String) ivyModuleDescriptor.getExtraInfo().get(key);
-        if (result == null) {
+        if ((result == null) || !MAVEN2_CONF_MAPPING.containsKey(result)) {
             result = "compile";
         }
         return result;



Mime
View raw message