Skip to content

Commit a1f737a

Browse files
author
Zhen Li
authored
Merge pull request #284 from CrystalMethod/osgified
osgify artefact MANIFEST.MF (jar + sources)
2 parents 3ca3290 + d4116c0 commit a1f737a

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

driver/osgi.bnd

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package-version=${version;===;${Bundle-Version}}
2+
3+
Export-Package: \
4+
!*.internal.*, \
5+
*;version="${package-version}"
6+
7+
Import-Package: \
8+
*
9+

driver/pom.xml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<properties>
77
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
88
<build.revision></build.revision>
9+
<bundle.name>${project.groupId}.${project.artifactId}</bundle.name>
10+
<maven.build.timestamp.format>'v'yyyyMMdd-HHmm</maven.build.timestamp.format>
911
</properties>
1012

1113
<parent>
@@ -118,6 +120,16 @@
118120
<goals>
119121
<goal>jar</goal>
120122
</goals>
123+
<configuration>
124+
<archive>
125+
<manifestEntries>
126+
<Bundle-Name>${project.name} (Source)</Bundle-Name>
127+
<Bundle-SymbolicName>${bundle.name}.source</Bundle-SymbolicName>
128+
<Bundle-Version>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${build.timestamp}</Bundle-Version>
129+
<Eclipse-SourceBundle>${bundle.name};version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${build.timestamp}";roots:="."</Eclipse-SourceBundle>
130+
</manifestEntries>
131+
</archive>
132+
</configuration>
121133
</execution>
122134
</executions>
123135
</plugin>
@@ -147,6 +159,7 @@
147159
<configuration>
148160
<archive>
149161
<index>true</index>
162+
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
150163
<manifest>
151164
<packageName>org/neo4j/driver</packageName>
152165
</manifest>
@@ -157,6 +170,47 @@
157170
</archive>
158171
</configuration>
159172
</plugin>
173+
<plugin>
174+
<groupId>org.codehaus.mojo</groupId>
175+
<artifactId>build-helper-maven-plugin</artifactId>
176+
<version>1.12</version>
177+
<executions>
178+
<execution>
179+
<id>set-osgi-version</id>
180+
<phase>validate</phase>
181+
<goals>
182+
<goal>parse-version</goal>
183+
</goals>
184+
</execution>
185+
</executions>
186+
</plugin>
187+
<plugin>
188+
<groupId>org.apache.felix</groupId>
189+
<artifactId>maven-bundle-plugin</artifactId>
190+
<version>3.2.0</version>
191+
<extensions>true</extensions>
192+
<executions>
193+
<execution>
194+
<id>bundle-manifest</id>
195+
<phase>process-classes</phase>
196+
<goals>
197+
<goal>manifest</goal>
198+
</goals>
199+
</execution>
200+
</executions>
201+
<configuration>
202+
<instructions>
203+
<Bundle-SymbolicName>${bundle.name}</Bundle-SymbolicName>
204+
<Bundle-Version>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${build.timestamp}</Bundle-Version>
205+
<_snapshot>${maven.build.timestamp}</_snapshot>
206+
<_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
207+
<_removeheaders>Bnd-*,Private-Package</_removeheaders>
208+
<_nouses>true</_nouses>
209+
<!-- each module can override these defaults in their osgi.bnd file -->
210+
<_include>-osgi.bnd</_include>
211+
</instructions>
212+
</configuration>
213+
</plugin>
160214
<plugin>
161215
<groupId>org.apache.maven.plugins</groupId>
162216
<artifactId>maven-surefire-plugin</artifactId>

0 commit comments

Comments
 (0)