You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2018/03/11 00:19:30 UTC

maven-resolver git commit: [MRESOLVER-31] Use the Felix Bundle Plugin to generate OSGi metadata

Repository: maven-resolver
Updated Branches:
  refs/heads/master 142469e78 -> 9cb6c68d6


[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.


Project: http://git-wip-us.apache.org/repos/asf/maven-resolver/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-resolver/commit/9cb6c68d
Tree: http://git-wip-us.apache.org/repos/asf/maven-resolver/tree/9cb6c68d
Diff: http://git-wip-us.apache.org/repos/asf/maven-resolver/diff/9cb6c68d

Branch: refs/heads/master
Commit: 9cb6c68d66627a1ecdaa7b9f89711de89d9433ab
Parents: 142469e
Author: Mat Booth <ma...@redhat.com>
Authored: Fri Mar 9 12:34:41 2018 +0000
Committer: Michael Osipov <mi...@apache.org>
Committed: Sun Mar 11 01:18:42 2018 +0100

----------------------------------------------------------------------
 maven-resolver-api/pom.xml                      | 21 +++++++++++++++-
 maven-resolver-connector-basic/pom.xml          | 16 +++++++++++-
 .../maven-resolver-demo-snippets/pom.xml        |  1 +
 maven-resolver-impl/pom.xml                     | 16 +++++++++++-
 maven-resolver-spi/pom.xml                      | 21 +++++++++++++++-
 maven-resolver-test-util/pom.xml                | 21 +++++++++++++++-
 maven-resolver-transport-classpath/pom.xml      | 16 +++++++++++-
 maven-resolver-transport-file/pom.xml           | 16 +++++++++++-
 maven-resolver-transport-http/pom.xml           | 16 +++++++++++-
 maven-resolver-transport-wagon/pom.xml          | 16 +++++++++++-
 maven-resolver-util/pom.xml                     | 21 +++++++++++++++-
 pom.xml                                         | 26 +++++++++++++++++++-
 12 files changed, 196 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/9cb6c68d/maven-resolver-api/pom.xml
----------------------------------------------------------------------
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>

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/9cb6c68d/maven-resolver-connector-basic/pom.xml
----------------------------------------------------------------------
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>

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/9cb6c68d/maven-resolver-demos/maven-resolver-demo-snippets/pom.xml
----------------------------------------------------------------------
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>
 

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/9cb6c68d/maven-resolver-impl/pom.xml
----------------------------------------------------------------------
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>

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/9cb6c68d/maven-resolver-spi/pom.xml
----------------------------------------------------------------------
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>

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/9cb6c68d/maven-resolver-test-util/pom.xml
----------------------------------------------------------------------
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>

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/9cb6c68d/maven-resolver-transport-classpath/pom.xml
----------------------------------------------------------------------
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>

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/9cb6c68d/maven-resolver-transport-file/pom.xml
----------------------------------------------------------------------
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>

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/9cb6c68d/maven-resolver-transport-http/pom.xml
----------------------------------------------------------------------
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>

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/9cb6c68d/maven-resolver-transport-wagon/pom.xml
----------------------------------------------------------------------
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>

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/9cb6c68d/maven-resolver-util/pom.xml
----------------------------------------------------------------------
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>

http://git-wip-us.apache.org/repos/asf/maven-resolver/blob/9cb6c68d/pom.xml
----------------------------------------------------------------------
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>