Make BND MANIFEST generation more robust.
authorMathieu Baudier <mbaudier@argeo.org>
Sun, 16 Feb 2020 09:10:27 +0000 (10:10 +0100)
committerMathieu Baudier <mbaudier@argeo.org>
Sun, 16 Feb 2020 09:10:27 +0000 (10:10 +0100)
pom.xml

diff --git a/pom.xml b/pom.xml
index e69a220dfbbc40e91612ba2a096db510ce587de5..ab1b12f4975885e2d0cfe9f4675f077981a3bf0e 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -110,6 +110,9 @@ limitations under the License.
                                <excludes>
                                        <exclude>.*</exclude>
                                        <exclude>.*/**</exclude>
+                                       <!-- It is set explicitely in the jar plugin configuration. We don't 
+                                               copy it in order to avoid side-effects with BND -->
+                                       <exclude>META-INF/MANIFEST.MF</exclude>
                                        <exclude>src/**</exclude>
                                        <exclude>ext/**</exclude>
                                        <exclude>target/**</exclude>
@@ -247,6 +250,10 @@ limitations under the License.
                                        <extensions>true</extensions>
                                        <configuration>
                                                <manifestLocation>META-INF</manifestLocation>
+                                               <niceManifest>true</niceManifest>
+                                               <noWarningProjectTypes>
+                                                       <noWarningProjectType>pom</noWarningProjectType>
+                                               </noWarningProjectTypes>
                                                <instructions>
                                                        <_include>bnd.bnd</_include>
                                                        <Bundle-Version>${project.version}-r${maven.build.timestamp}</Bundle-Version>
@@ -262,15 +269,6 @@ limitations under the License.
                                                        <!-- <SLC-Git-Commit-Count>${git.closest.tag.commit.count}</SLC-Git-Commit-Count> -->
                                                </instructions>
                                        </configuration>
-                                       <executions>
-                                               <execution>
-                                                       <id>bundle-manifest</id>
-                                                       <phase>process-classes</phase>
-                                                       <goals>
-                                                               <goal>manifest</goal>
-                                                       </goals>
-                                               </execution>
-                                       </executions>
                                </plugin>
                                <!-- Codehaus -->
                                <plugin>
@@ -302,19 +300,6 @@ limitations under the License.
                        </plugins>
                </pluginManagement>
                <plugins>
-                       <!-- <plugin> -->
-                       <!-- <artifactId>maven-clean-plugin</artifactId> -->
-                       <!-- <configuration> -->
-                       <!-- <filesets> -->
-                       <!-- <fileset> -->
-                       <!-- <directory>META-INF</directory> -->
-                       <!-- <includes> -->
-                       <!-- <include>MANIFEST.MF</include> -->
-                       <!-- </includes> -->
-                       <!-- </fileset> -->
-                       <!-- </filesets> -->
-                       <!-- </configuration> -->
-                       <!-- </plugin> -->
                        <!-- <plugin> -->
                        <!-- <groupId>pl.project13.maven</groupId> -->
                        <!-- <artifactId>git-commit-id-plugin</artifactId> -->
@@ -354,6 +339,44 @@ limitations under the License.
                                        </execution>
                                </executions>
                        </plugin>
+                       <!-- MANIFEST generation by BND -->
+                       <!-- <plugin> -->
+                       <!-- <artifactId>maven-clean-plugin</artifactId> -->
+                       <!-- <executions> -->
+                       <!-- <execution> -->
+                       <!-- <id>bundle-manifest-clean</id> -->
+                       <!-- <phase>process-classes</phase> -->
+                       <!-- <goals> -->
+                       <!-- <goal>clean</goal> -->
+                       <!-- </goals> -->
+                       <!-- <configuration> -->
+                       <!-- <excludeDefaultDirectories>true</excludeDefaultDirectories> -->
+                       <!-- <filesets> -->
+                       <!-- <fileset> -->
+                       <!-- <directory>META-INF</directory> -->
+                       <!-- <includes> -->
+                       <!-- <include>MANIFEST.MF</include> -->
+                       <!-- </includes> -->
+                       <!-- </fileset> -->
+                       <!-- </filesets> -->
+                       <!-- </configuration> -->
+                       <!-- </execution> -->
+                       <!-- </executions> -->
+                       <!-- </plugin> -->
+                       <plugin>
+                               <groupId>org.apache.felix</groupId>
+                               <artifactId>maven-bundle-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <id>bundle-manifest</id>
+                                               <phase>process-classes</phase>
+                                               <goals>
+                                                       <goal>manifest</goal>
+                                               </goals>
+                                       </execution>
+                               </executions>
+                       </plugin>
+                       <!-- Releases -->
                        <plugin>
                                <artifactId>maven-release-plugin</artifactId>
                                <configuration>
@@ -361,10 +384,6 @@ limitations under the License.
                                        <releaseProfiles>rpmbuild</releaseProfiles>
                                </configuration>
                        </plugin>
-                       <plugin>
-                               <groupId>org.apache.felix</groupId>
-                               <artifactId>maven-bundle-plugin</artifactId>
-                       </plugin>
                </plugins>
        </build>
        <dependencies>