You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2008/02/02 10:27:53 UTC
svn commit: r617775 -
/geronimo/server/branches/2.1/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java
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;