geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r617775 - /geronimo/server/branches/2.1/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java
Date Sat, 02 Feb 2008 09:27:53 GMT
Author: djencks
Date: Sat Feb  2 01:27:50 2008
New Revision: 617775

URL: http://svn.apache.org/viewvc?rev=617775&view=rev
Log:
GERONIMO-3805 avoid NPEs from incomplete poms, port from trunk

Modified:
    geronimo/server/branches/2.1/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java

Modified: geronimo/server/branches/2.1/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java?rev=617775&r1=617774&r2=617775&view=diff
==============================================================================
--- geronimo/server/branches/2.1/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java
(original)
+++ geronimo/server/branches/2.1/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java
Sat Feb  2 01:27:50 2008
@@ -137,17 +137,19 @@
 
         PluginType metadata = new PluginType();
         metadata.setName(project.getName());
-        metadata.setAuthor(project.getOrganization().getName());
-        metadata.setUrl(project.getOrganization().getUrl());
+        metadata.setAuthor(project.getOrganization() == null? "unknown": project.getOrganization().getName());
+        metadata.setUrl(project.getOrganization() == null? "unknown": project.getOrganization().getUrl());
         metadata.setDescription(project.getDescription());
         metadata.setCategory(category);
 
-        for (Object licenseObj : project.getLicenses()) {
-            License license = (License) licenseObj;
-            LicenseType licenseType = new LicenseType();
-            licenseType.setValue(license.getName());
-            licenseType.setOsiApproved(osiApproved);
-            metadata.getLicense().add(licenseType);
+        if (project.getLicenses() != null) {
+            for (Object licenseObj : project.getLicenses()) {
+                License license = (License) licenseObj;
+                LicenseType licenseType = new LicenseType();
+                licenseType.setValue(license.getName());
+                licenseType.setOsiApproved(osiApproved);
+                metadata.getLicense().add(licenseType);
+            }
         }
 
         PluginArtifactType instance;



Mime
View raw message