Author: maartenc Date: Tue Oct 21 12:26:15 2008 New Revision: 706728 URL: http://svn.apache.org/viewvc?rev=706728&view=rev Log: FIX: Maven pom license has name as optional element (IVY-949)
Modified: ant/ivy/core/trunk/CHANGES.txt ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java Modified: ant/ivy/core/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=706728&r1=706727&r2=706728&view=diff ============================================================================== --- ant/ivy/core/trunk/CHANGES.txt (original) +++ ant/ivy/core/trunk/CHANGES.txt Tue Oct 21 12:26:15 2008 @@ -111,6 +111,7 @@ - FIX: Support for passing arbitrary arguments to the -main invoked class when using the standalone mode is severely limited (IVY-952) (thanks to Patrick Woodworth) - FIX: Correctly set ivy.resolved.configurations property when the conf string includes a negation operator (IVY-951) (thanks to Patrick Woodworth) - FIX: Maven pom license url can contain xml entities (IVY-950) +- FIX: Maven pom license has name as optional element (IVY-949) 2.0.0-rc1 ===================================== Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java?rev=706728&r1=706727&r2=706728&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/plugins/parser/m2/PomReader.java Tue Oct 21 12:26:15 2008 @@ -222,9 +222,18 @@ if (LICENSE.equals(license.getNodeName())) { String name = getFirstChildText(license, LICENSE_NAME); String url = getFirstChildText(license, LICENSE_URL); - if (name != null || url != null) { - lics.add(new License(name, url)); + + if ((name == null) && (url == null)) { + // move to next license + continue; } + + if (name == null) { + // The license name is required in Ivy but not in a POM! + name = "Unknown License"; + } + + lics.add(new License(name, url)); } } return (License[]) lics.toArray(new License[lics.size()]);