Fix manifest goal for jar projects with no sources; also 'calcManifest' method now expects caller to store the manifest rather than rely on a side-effect

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1366107 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
index bbf361d..aea746f 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
@@ -172,7 +172,14 @@
 
         if ( !file.exists() )
         {
-            throw new FileNotFoundException( file.getPath() );
+            if ( file.equals( getOutputDirectory() ) )
+            {
+                file.mkdirs();
+            }
+            else
+            {
+                throw new FileNotFoundException( file.getPath() );
+            }
         }
 
         Builder analyzer = getOSGiBuilder( project, instructions, properties, classpath );
@@ -203,7 +210,7 @@
         else
         {
             analyzer.mergeManifest( analyzer.getJar().getManifest() );
-            analyzer.calcManifest();
+            analyzer.getJar().setManifest( analyzer.calcManifest() );
         }
 
         mergeMavenManifest( project, analyzer );