Applied patch (FELIXM2-10).


git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@472012 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/tools/maven2/maven-bundle-plugin/src/main/java/org/apache/felix/tools/maven2/bundleplugin/BundlePlugin.java b/tools/maven2/maven-bundle-plugin/src/main/java/org/apache/felix/tools/maven2/bundleplugin/BundlePlugin.java
index 4c25c33..ef48dec 100644
--- a/tools/maven2/maven-bundle-plugin/src/main/java/org/apache/felix/tools/maven2/bundleplugin/BundlePlugin.java
+++ b/tools/maven2/maven-bundle-plugin/src/main/java/org/apache/felix/tools/maven2/bundleplugin/BundlePlugin.java
@@ -105,9 +105,15 @@
    header(properties, Analyzer.BUNDLE_LICENSE, printLicenses(project
      .getLicenses()));
    header(properties, Analyzer.BUNDLE_NAME, project.getName());
-   header(properties, Analyzer.BUNDLE_VENDOR, project
-     .getOrganization());
-   header(properties, Analyzer.INCLUDE_RESOURCE, "src/main/resources/");
+   
+   if (project.getOrganization() != null) {
+     header(properties, Analyzer.BUNDLE_VENDOR, project
+       .getOrganization().getName());
+   }
+     
+   if (new File("src/main/resources").exists()) {
+     header(properties, Analyzer.INCLUDE_RESOURCE, "src/main/resources/");
+   }
  
    properties.putAll(project.getProperties());
    properties.putAll(project.getModel().getProperties());
@@ -144,6 +150,7 @@
     throw new MojoFailureException("Found errors, see log");
    }
    else {
+    jarFile.getParentFile().mkdirs();
     builder.getJar().write(jarFile);
     project.getArtifact().setFile(jarFile);
    }
@@ -226,7 +233,10 @@
   */
  private Jar[] getClasspath() throws ZipException, IOException {
   List list = new ArrayList();
-  list.add(new Jar(".", outputDirectory));
+  
+  if (outputDirectory != null && outputDirectory.exists()) {
+    list.add(new Jar(".", outputDirectory));
+  }
  
   Set artifacts = project.getArtifacts();
   for (Iterator it = artifacts.iterator(); it.hasNext();) {