[MRESOLVER-31] Use the Felix Bundle Plugin to generate OSGi metadata
This closes #8
This restores the OSGi metadata that was lost in the switch from
Eclipse Aether to Maven Resolver and allows maven-resolver to be
used in OSGi runtime environments.
diff --git a/maven-resolver-api/pom.xml b/maven-resolver-api/pom.xml
index 9298d45..f412983 100644
--- a/maven-resolver-api/pom.xml
+++ b/maven-resolver-api/pom.xml
@@ -36,7 +36,8 @@
</description>
<properties>
- <AutomaticModuleName>org.apache.maven.resolver</AutomaticModuleName>
+ <Automatic-Module-Name>org.apache.maven.resolver</Automatic-Module-Name>
+ <Bundle-SymbolicName>${Automatic-Module-Name}.api</Bundle-SymbolicName>
</properties>
<dependencies>
@@ -51,4 +52,22 @@
<scope>test</scope>
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${project.build.directory}/osgi/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/maven-resolver-connector-basic/pom.xml b/maven-resolver-connector-basic/pom.xml
index 5633967..781d246 100644
--- a/maven-resolver-connector-basic/pom.xml
+++ b/maven-resolver-connector-basic/pom.xml
@@ -36,7 +36,8 @@
</description>
<properties>
- <AutomaticModuleName>org.apache.maven.resolver.connector.basic</AutomaticModuleName>
+ <Automatic-Module-Name>org.apache.maven.resolver.connector.basic</Automatic-Module-Name>
+ <Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
</properties>
<dependencies>
@@ -87,6 +88,19 @@
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
</plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${project.build.directory}/osgi/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
diff --git a/maven-resolver-demos/maven-resolver-demo-snippets/pom.xml b/maven-resolver-demos/maven-resolver-demo-snippets/pom.xml
index d709015..758ea17 100644
--- a/maven-resolver-demos/maven-resolver-demo-snippets/pom.xml
+++ b/maven-resolver-demos/maven-resolver-demo-snippets/pom.xml
@@ -37,6 +37,7 @@
</description>
<properties>
+ <Automatic-Module-Name>org.apache.maven.resolver.demo.snippets</Automatic-Module-Name>
<mavenVersion>3.5.0</mavenVersion>
</properties>
diff --git a/maven-resolver-impl/pom.xml b/maven-resolver-impl/pom.xml
index 6c52bf9..5864ef0 100644
--- a/maven-resolver-impl/pom.xml
+++ b/maven-resolver-impl/pom.xml
@@ -36,7 +36,8 @@
</description>
<properties>
- <AutomaticModuleName>org.apache.maven.resolver.impl</AutomaticModuleName>
+ <Automatic-Module-Name>org.apache.maven.resolver.impl</Automatic-Module-Name>
+ <Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
</properties>
<dependencies>
@@ -100,6 +101,19 @@
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
</plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${project.build.directory}/osgi/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
diff --git a/maven-resolver-spi/pom.xml b/maven-resolver-spi/pom.xml
index 6754b17..f8352dc 100644
--- a/maven-resolver-spi/pom.xml
+++ b/maven-resolver-spi/pom.xml
@@ -36,7 +36,8 @@
</description>
<properties>
- <AutomaticModuleName>org.apache.maven.resolver.spi</AutomaticModuleName>
+ <Automatic-Module-Name>org.apache.maven.resolver.spi</Automatic-Module-Name>
+ <Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
</properties>
<dependencies>
@@ -55,4 +56,22 @@
<scope>test</scope>
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${project.build.directory}/osgi/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/maven-resolver-test-util/pom.xml b/maven-resolver-test-util/pom.xml
index e8e274b..9d0a349 100644
--- a/maven-resolver-test-util/pom.xml
+++ b/maven-resolver-test-util/pom.xml
@@ -36,7 +36,8 @@
</description>
<properties>
- <AutomaticModuleName>org.apache.maven.resolver.testutil</AutomaticModuleName>
+ <Automatic-Module-Name>org.apache.maven.resolver.testutil</Automatic-Module-Name>
+ <Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
</properties>
<dependencies>
@@ -59,4 +60,22 @@
<scope>test</scope>
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${project.build.directory}/osgi/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/maven-resolver-transport-classpath/pom.xml b/maven-resolver-transport-classpath/pom.xml
index d0d7159..9105292 100644
--- a/maven-resolver-transport-classpath/pom.xml
+++ b/maven-resolver-transport-classpath/pom.xml
@@ -36,7 +36,8 @@
</description>
<properties>
- <AutomaticModuleName>org.apache.maven.resolver.transport.classpath</AutomaticModuleName>
+ <Automatic-Module-Name>org.apache.maven.resolver.transport.classpath</Automatic-Module-Name>
+ <Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
</properties>
<dependencies>
@@ -87,6 +88,19 @@
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
</plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${project.build.directory}/osgi/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
diff --git a/maven-resolver-transport-file/pom.xml b/maven-resolver-transport-file/pom.xml
index c020bed..239a4e5 100644
--- a/maven-resolver-transport-file/pom.xml
+++ b/maven-resolver-transport-file/pom.xml
@@ -36,7 +36,8 @@
</description>
<properties>
- <AutomaticModuleName>org.apache.maven.resolver.transport.file</AutomaticModuleName>
+ <Automatic-Module-Name>org.apache.maven.resolver.transport.file</Automatic-Module-Name>
+ <Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
</properties>
<dependencies>
@@ -83,6 +84,19 @@
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
</plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${project.build.directory}/osgi/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
diff --git a/maven-resolver-transport-http/pom.xml b/maven-resolver-transport-http/pom.xml
index f1bae25..5ce8521 100644
--- a/maven-resolver-transport-http/pom.xml
+++ b/maven-resolver-transport-http/pom.xml
@@ -36,7 +36,8 @@
</description>
<properties>
- <AutomaticModuleName>org.apache.maven.resolver.transport.http</AutomaticModuleName>
+ <Automatic-Module-Name>org.apache.maven.resolver.transport.http</Automatic-Module-Name>
+ <Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
<jettyVersion>9.2.23.v20171218</jettyVersion>
</properties>
@@ -140,6 +141,19 @@
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
</plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${project.build.directory}/osgi/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
diff --git a/maven-resolver-transport-wagon/pom.xml b/maven-resolver-transport-wagon/pom.xml
index a513f32..b785600 100644
--- a/maven-resolver-transport-wagon/pom.xml
+++ b/maven-resolver-transport-wagon/pom.xml
@@ -36,7 +36,8 @@
</description>
<properties>
- <AutomaticModuleName>org.apache.maven.resolver.transport.wagon</AutomaticModuleName>
+ <Automatic-Module-Name>org.apache.maven.resolver.transport.wagon</Automatic-Module-Name>
+ <Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
</properties>
<dependencies>
@@ -119,6 +120,19 @@
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
</plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${project.build.directory}/osgi/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
</plugins>
</build>
</project>
diff --git a/maven-resolver-util/pom.xml b/maven-resolver-util/pom.xml
index de5bdb1..bcd5b4b 100644
--- a/maven-resolver-util/pom.xml
+++ b/maven-resolver-util/pom.xml
@@ -36,7 +36,8 @@
</description>
<properties>
- <AutomaticModuleName>org.apache.maven.resolver.util</AutomaticModuleName>
+ <Automatic-Module-Name>org.apache.maven.resolver.util</Automatic-Module-Name>
+ <Bundle-SymbolicName>${Automatic-Module-Name}</Bundle-SymbolicName>
</properties>
<dependencies>
@@ -60,4 +61,22 @@
<scope>test</scope>
</dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>${project.build.directory}/osgi/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/pom.xml b/pom.xml
index 3a6a692..3e199d4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -348,12 +348,36 @@
</configuration>
</plugin>
<plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>3.5.0</version>
+ <configuration>
+ <manifestLocation>${project.build.directory}/osgi</manifestLocation>
+ <instructions>
+ <Bundle-SymbolicName>${Bundle-SymbolicName}</Bundle-SymbolicName>
+ <Bundle-DocURL>${project.url}</Bundle-DocURL>
+ <_removeheaders>Bnd-LastModified,Include-Resource</_removeheaders>
+ <!-- Export all packages except those with "internal" in their names -->
+ <_exportcontents>!*internal*,*</_exportcontents>
+ </instructions>
+ </configuration>
+ <executions>
+ <execution>
+ <id>bundle-manifest</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>manifest</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
- <Automatic-Module-Name>${AutomaticModuleName}</Automatic-Module-Name>
+ <Automatic-Module-Name>${Automatic-Module-Name}</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>