FELIX-360: commit fixes that aren't dependent on the unreleased maven components
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@579247 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
index 94baa78..42af16a 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
@@ -124,7 +124,6 @@
*/
private Maven2OsgiConverter maven2OsgiConverter;
-
private static final String MAVEN_RESOURCES = "{maven-resources}";
private static final String MAVEN_RESOURCES_REGEX = "\\{maven-resources\\}";
@@ -392,10 +391,12 @@
{
License l = (License) i.next();
String url = l.getUrl();
+ if (url == null) continue;
sb.append(del);
sb.append(url);
del = ", ";
}
+ if (sb.length() == 0) return null;
return sb;
}
@@ -446,7 +447,8 @@
File file = this.getFile(artifact);
if (file == null)
{
- throw new RuntimeException("File is not available for artifact " + artifact + " in project " + project.getArtifact());
+ getLog().warn( "File is not available for artifact " + artifact + " in project " + project.getArtifact() );
+ continue;
}
Jar jar = new Jar(artifact.getArtifactId(), file);
list.add(jar);
@@ -539,8 +541,10 @@
properties.put(Analyzer.BUNDLE_VERSION, project.getVersion());
this.header(properties, Analyzer.BUNDLE_DESCRIPTION, project
.getDescription());
- this.header(properties, Analyzer.BUNDLE_LICENSE, this.printLicenses(project
- .getLicenses()));
+ StringBuffer licenseText = this.printLicenses(project.getLicenses());
+ if (licenseText != null) {
+ this.header(properties, Analyzer.BUNDLE_LICENSE, licenseText);
+ }
this.header(properties, Analyzer.BUNDLE_NAME, project.getName());
if (project.getOrganization() != null)