Skip to content

Commit 81e84ca

Browse files
authored
OSGi Support (#136)
- Removed maven-jar-plugin configuration. - Added bnd-maven-plugin with execution goals. - Configured Bundle-SymbolicName and Export-Package. - Excluded unnecessary headers from the manifest. - Improved JPMS module info generation. Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
1 parent 178d5ed commit 81e84ca

2 files changed

Lines changed: 35 additions & 15 deletions

File tree

.github/workflows/maven.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Set up JDK 11
2525
uses: actions/setup-java@v3
2626
with:
27-
java-version: '11'
27+
java-version: '17'
2828
distribution: 'temurin'
2929
cache: maven
3030
- name: Build with Maven

pom.xml

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,6 @@
170170
<debug>true</debug>
171171
<debuglevel>none</debuglevel>
172172
<release>8</release>
173-
<archive>
174-
<manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
175-
</archive>
176173
<compilerArgument>-Xlint:all</compilerArgument>
177174
<compilerArguments>
178175
<Werror />
@@ -186,17 +183,40 @@
186183
<configuration>
187184
</configuration>
188185
</plugin>
189-
<plugin>
190-
<groupId>org.apache.maven.plugins</groupId>
191-
<artifactId>maven-jar-plugin</artifactId>
192-
<configuration>
193-
<archive>
194-
<manifestEntries>
195-
<Automatic-Module-Name>com.grack.nanojson</Automatic-Module-Name>
196-
</manifestEntries>
197-
</archive>
198-
</configuration>
199-
</plugin>
186+
<plugin>
187+
<groupId>biz.aQute.bnd</groupId>
188+
<artifactId>bnd-maven-plugin</artifactId>
189+
<extensions>true</extensions>
190+
<executions>
191+
<execution>
192+
<id>jar</id>
193+
<goals>
194+
<goal>jar</goal>
195+
</goals>
196+
<configuration>
197+
<bnd><![CDATA[
198+
Bundle-SymbolicName: ${groupId}.${artifactId}
199+
Export-Package: com.grack.nanojson
200+
-jpms-module-info: com.grack.nanojson
201+
-noextraheaders:
202+
-removeheaders: \
203+
Tool, \
204+
Bnd-LastModified, \
205+
Bnd-ManifestVersion, \
206+
Build-Jdk, \
207+
Built-By, \
208+
Created-By, \
209+
Private-Package, \
210+
Bundle-DocURL, \
211+
Bundle-Name, \
212+
Bundle-Vendor,\
213+
Bundle-Description,\
214+
Bundle-SCM
215+
]]></bnd>
216+
</configuration>
217+
</execution>
218+
</executions>
219+
</plugin>
200220
</plugins>
201221
</build>
202222

0 commit comments

Comments
 (0)