Add bnd-parent 27/95727/12
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 9 Apr 2021 10:26:23 +0000 (12:26 +0200)
committerStephen Kitt <skitt@redhat.com>
Fri, 24 Sep 2021 08:06:48 +0000 (08:06 +0000)
https://bnd.bndtools.org/ which is used by maven-bundle-plugin, has
produced an alternative, nicer Maven integration with bnd-maven-plugin:
https://github.com/bndtools/bnd/tree/master/maven/bnd-maven-plugin

Since the way the plugin operates is significantly different, introduce
an alternative parent pom.xml, so that downstreams can migrate as they
choose.

Also convert bundles-test-lib to use this new capability.

JIRA: ODLPARENT-258
Change-Id: Ifa21ef51d95e88c5208aba35b3d6218da1f6eb1d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bnd-parent/pom.xml [new file with mode: 0644]
bundles-test-lib/pom.xml
bundles-test-lib/src/main/java/org/opendaylight/odlparent/bundlestest/lib/package-info.java
docs/pom.xml
pom.xml

diff --git a/bnd-parent/pom.xml b/bnd-parent/pom.xml
new file mode 100644 (file)
index 0000000..27298f2
--- /dev/null
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+ Copyright (c) 2021 PANTHEON.tech, s.r.o. and others.  All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.opendaylight.odlparent</groupId>
+        <artifactId>odlparent</artifactId>
+        <version>9.0.7-SNAPSHOT</version>
+        <relativePath>../odlparent</relativePath>
+    </parent>
+
+    <artifactId>bnd-parent</artifactId>
+    <packaging>pom</packaging>
+    <name>ODL :: odlparent :: ${project.artifactId}</name>
+
+    <!-- Annotations processed by bnd-maven-plugin -->
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>biz.aQute.bnd</groupId>
+                <artifactId>biz.aQute.bnd.annotation</artifactId>
+                <version>5.3.0</version>
+                <scope>provided</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>biz.aQute.bnd</groupId>
+                    <artifactId>bnd-maven-plugin</artifactId>
+                    <version>5.3.0</version>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+
+        <plugins>
+            <plugin>
+                <artifactId>maven-javadoc-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <artifactId>maven-source-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>biz.aQute.bnd</groupId>
+                <artifactId>bnd-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>bnd-process</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <!--
+                See https://github.com/bndtools/bnd/tree/master/maven/bnd-maven-plugin#important-note
+                and https://issues.apache.org/jira/browse/MJAR-193
+            -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
index c8c9197693d7fe7702b2e126f733f9010224bf3c..bf8ec403ad7610cc0213608ed48b99248a21e0de 100644 (file)
 
   <parent>
     <groupId>org.opendaylight.odlparent</groupId>
-    <artifactId>bundle-parent</artifactId>
+    <artifactId>bnd-parent</artifactId>
     <version>9.0.7-SNAPSHOT</version>
-    <relativePath>../bundle-parent</relativePath>
+    <relativePath>../bnd-parent</relativePath>
   </parent>
 
   <artifactId>bundles-test-lib</artifactId>
   <name>ODL :: odlparent :: ${project.artifactId}</name>
-  <packaging>bundle</packaging>
+  <packaging>jar</packaging>
 
   <properties>
     <!-- Opt-in to our optional code quality checks -->
   </properties>
 
   <dependencies>
+    <dependency>
+      <groupId>org.osgi</groupId>
+      <artifactId>osgi.annotation</artifactId>
+    </dependency>
     <dependency>
       <groupId>org.osgi</groupId>
       <artifactId>osgi.core</artifactId>
-      <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.karaf.bundle</groupId>
index 410ddab7dcf3da0dd08845cbf340c73079d07e4c..0f703d15a81cfb0fb80d42f39ec42936cd64916e 100644 (file)
@@ -6,4 +6,5 @@
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
 @org.eclipse.jdt.annotation.NonNullByDefault
+@org.osgi.annotation.bundle.Export
 package org.opendaylight.odlparent.bundlestest.lib;
index b004185c39a7734288e891e73a45f569942d04b4..6a1aaf0221a90c88e7fd643e17e9952d3576e02f 100644 (file)
         </dependency>
 
         <!-- Also add dependencies we are using -->
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>osgi.annotation</artifactId>
+            <scope>provided</scope>
+        </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>osgi.core</artifactId>
diff --git a/pom.xml b/pom.xml
index 9e9c2903ec60493142595bb11275aacc07ba3e40..f1fb912ee4239849f12c7d4a22960aa3e445142c 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -48,6 +48,7 @@
         <module>karaf-util</module>
 
         <!-- Parent POMs -->
+        <module>bnd-parent</module>
         <module>bundle-parent</module>
         <module>untested-single-feature-parent</module>
         <module>single-feature-parent</module>