Package: maven-bundle-plugin / 2.3.7-2

backward-compatibility.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Description: Fixes a regression in the version 2.3.7 causing two build
 failures on javamail (#761548) and sisu-guice (#761522).
 .
 For javamail, checking out a clean copy of the upstream source,
 upgrading maven-bundle-plugin to 2.3.7 in the pom and building directly
 with Maven works fine. So the upgrade to 2.3.7 alone isn't enough to
 explain the regression, something else specific to the Debian packaging
 is involved.
 .
 The regression was caused by the fix for FELIX-3165:
   https://issues.apache.org/jira/browse/FELIX-3165
   https://svn.apache.org/r1184887
 .
 This patch reverts to the old behaviour only when the
 debian.maven-bundle-plugin.compatibility property is set to true.

Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: not-needed
Bug-Debian: http://bugs.debian.org/761548
            http://bugs.debian.org/761522
--- a/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
+++ b/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
@@ -66,7 +66,18 @@
         Manifest manifest;
         try
         {
-            manifest = getManifest( project, instructions, properties, classpath );
+            if ( "true".equals( System.getProperty("debian.maven-bundle-plugin.compatibility") )
+                && supportedProjectTypes.contains( getProject().getArtifact().getType() ) )
+            {
+                getLog().info("maven-bundle-plugin 2.3.5 compatibility enabled");
+                Builder builder = buildOSGiBundle( project, instructions, properties, classpath );
+                manifest = builder.getJar().getManifest();
+                builder.close();
+            }
+            else
+            {
+                manifest = getManifest( project, instructions, properties, classpath );
+            }
         }
         catch ( FileNotFoundException e )
         {