Skip to content

Commit f9fdc39

Browse files
orzehKostyaSha
authored andcommitted
Generate OSGi compliant manifest (#797)
* Generate OSGi compliant manifest Manifest is generated by the Bundlor plugin according to the template defined in template.mf file. Import package versions are mainly derived from properties defined in pom.xml. Imports of Netty packages are marked as optional. * Export com.github.dockerjava.core package and subpackages
1 parent 2c47b76 commit f9fdc39

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

pom.xml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@
8686
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
8787
<maven-failsafe-plugin.version>2.19.1</maven-failsafe-plugin.version>
8888
<maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
89+
<maven-bundlor-plugin.version>1.1.2.RELEASE</maven-bundlor-plugin.version>
90+
<maven-build-helper-plugin.version>3.0.0</maven-build-helper-plugin.version>
8991
</properties>
9092

9193
<dependencies>
@@ -275,6 +277,19 @@
275277
</repository>
276278
</distributionManagement>
277279

280+
<pluginRepositories>
281+
<pluginRepository>
282+
<id>eclipse.virgo.build.bundles.release</id>
283+
<name>Eclipse Virgo Build</name>
284+
<url>http://build.eclipse.org/rt/virgo/maven/bundles/release</url>
285+
</pluginRepository>
286+
<pluginRepository>
287+
<id>com.springsource.repository.bundles.external</id>
288+
<name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
289+
<url>http://repository.springsource.com/maven/bundles/external</url>
290+
</pluginRepository>
291+
</pluginRepositories>
292+
278293
<build>
279294
<pluginManagement>
280295
<plugins>
@@ -301,6 +316,11 @@
301316
<groupId>org.apache.maven.plugins</groupId>
302317
<artifactId>maven-jar-plugin</artifactId>
303318
<version>${maven-jar-plugin.version}</version>
319+
<configuration>
320+
<archive>
321+
<manifestFile>target/classes/META-INF/MANIFEST.MF</manifestFile>
322+
</archive>
323+
</configuration>
304324
<executions>
305325
<execution>
306326
<goals>
@@ -436,6 +456,37 @@
436456
<groupId>org.apache.maven.plugins</groupId>
437457
<artifactId>maven-source-plugin</artifactId>
438458
</plugin>
459+
460+
<plugin>
461+
<groupId>org.eclipse.virgo.bundlor</groupId>
462+
<artifactId>org.eclipse.virgo.bundlor.maven</artifactId>
463+
<version>${maven-bundlor-plugin.version}</version>
464+
<executions>
465+
<execution>
466+
<id>bundlor</id>
467+
<goals>
468+
<goal>bundlor</goal>
469+
</goals>
470+
<configuration>
471+
<failOnWarnings>true</failOnWarnings>
472+
</configuration>
473+
</execution>
474+
</executions>
475+
</plugin>
476+
477+
<plugin>
478+
<groupId>org.codehaus.mojo</groupId>
479+
<artifactId>build-helper-maven-plugin</artifactId>
480+
<version>${maven-build-helper-plugin.version}</version>
481+
<executions>
482+
<execution>
483+
<id>parse-version</id>
484+
<goals>
485+
<goal>parse-version</goal>
486+
</goals>
487+
</execution>
488+
</executions>
489+
</plugin>
439490
</plugins>
440491
</build>
441492

template.mf

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Manifest-Version: 1.0
2+
Bundle-ManifestVersion: 2
3+
Bundle-SymbolicName: com.github.docker-java
4+
Bundle-Version: ${parsedVersion.osgiVersion}
5+
Bundle-Name: ${project.name}
6+
Version-Patterns:
7+
default;pattern="[=.=.=, =.+1.0)",
8+
short;pattern="[=.=,+1.0)"
9+
Import-Template:
10+
com.fasterxml.jackson.*;version="${jackson-jaxrs.version}",
11+
com.google.common.*;version="${guava.version:short}",
12+
io.netty.*;version="${netty.version:default}";resolution:=optional,
13+
javax.ws.rs.*;version="[2.0.0, 2.1.0)",
14+
org.apache.commons.codec.*;version="${commons-codec.version:short}",
15+
org.apache.commons.compress.*;version="${commons-compress.version:short}",
16+
org.apache.commons.io.*;version="${commons-io.version:short}",
17+
org.apache.commons.lang.*;version="${commons-lang.version:short}",
18+
org.apache.http.*;version="[4.4.0, 4.6.0)",
19+
org.bouncycastle.*;version="${bouncycastle.version:short}",
20+
org.glassfish.jersey.*;version="${jersey.version:default}",
21+
org.slf4j.*;version="[1.7.0, 1.8.0)",
22+
org.newsclub.net.unix;version="${junixsocket.version:default}";resolution:=optional
23+
Excluded-Exports:
24+
org.apache.http.impl.io,
25+
org.newsclub.net.unix,
26+
com.github.dockerjava.jaxrs.*,
27+
com.github.dockerjava.netty.*
28+
Excluded-Imports:
29+
javax.annotation,
30+
javax.net.ssl,
31+
edu.umd.cs.findbugs.annotations

0 commit comments

Comments
 (0)