Skip to content

add osgi headers via maven-bundle-plugin #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ Some users of this library (feel free to raise a PR if you want to be added):
* [Gerrit](https://www.gerritcodereview.com/) code review/Gitiles ([link](https://gerrit-review.googlesource.com/c/gitiles/+/353794))
* [Clerk](https://clerk.vision/) moldable live programming for Clojure
* [Znai](https://github.com/testingisdocumenting/znai)
* [Lucee](https://github.com/lucee/lucee)

See also
--------
Expand Down
9 changes: 9 additions & 0 deletions commonmark-ext-autolink/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,13 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
</plugins>
</build>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to only put this into the <build><plugins> of the parent pom instead of every child pom (I'm not sure if that works or not)?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the only way I could get it working, been a few months since I put this together, so I can't exactly remember variations I tried.

I'll revisit it and let you know what I find


</project>
9 changes: 9 additions & 0 deletions commonmark-ext-footnotes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,13 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
9 changes: 9 additions & 0 deletions commonmark-ext-gfm-strikethrough/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,13 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
9 changes: 9 additions & 0 deletions commonmark-ext-gfm-tables/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,14 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
9 changes: 9 additions & 0 deletions commonmark-ext-heading-anchor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,14 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
9 changes: 9 additions & 0 deletions commonmark-ext-image-attributes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,13 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
9 changes: 9 additions & 0 deletions commonmark-ext-ins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,13 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
9 changes: 9 additions & 0 deletions commonmark-ext-task-list-items/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,13 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
9 changes: 9 additions & 0 deletions commonmark-ext-yaml-front-matter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,13 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
9 changes: 9 additions & 0 deletions commonmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@
</profile>
</profiles>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
</plugins>
</build>

<licenses>
<license>
<name>BSD-2-Clause</name>
Expand Down
36 changes: 36 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,42 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.9</version>
<configuration>
<supportedProjectTypes>
<supportedProjectType>jar</supportedProjectType>
<supportedProjectType>bundle</supportedProjectType>
</supportedProjectTypes>
<instructions>
<Import-Package>
org.commonmark.*;-split-package:=merge-first
</Import-Package>
<Export-Package>
{local-packages}
</Export-Package>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this export internal packages? If yes, can we prevent them from being exported?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the file MANIFEST is produces

Manifest-Version: 1.0
Bnd-LastModified: 1737245630605
Build-Jdk-Spec: 21
Bundle-Description: Core of commonmark-java (a library for parsing Mar
 kdown to an AST, modifying the AST and rendering it to HTML or Markdo
 wn)
Bundle-License: https://opensource.org/licenses/BSD-2-Clause
Bundle-ManifestVersion: 2
Bundle-Name: commonmark-java core
Bundle-SymbolicName: org.commonmark
Bundle-Version: 0.24.1.SNAPSHOT
Created-By: Apache Maven Bundle Plugin 6.0.0
Export-Package: org.commonmark;version="0.24.1",org.commonmark.node;ve
 rsion="0.24.1",org.commonmark.parser;version="0.24.1";uses:="org.comm
 onmark,org.commonmark.node,org.commonmark.parser.beta,org.commonmark.
 parser.block,org.commonmark.parser.delimiter",org.commonmark.parser.b
 eta;version="0.24.1";uses:="org.commonmark.node,org.commonmark.parser
 ,org.commonmark.text",org.commonmark.parser.block;version="0.24.1";us
 es:="org.commonmark.node,org.commonmark.parser",org.commonmark.parser
 .delimiter;version="0.24.1";uses:="org.commonmark.node",org.commonmar
 k.renderer;version="0.24.1";uses:="org.commonmark.node",org.commonmar
 k.renderer.html;version="0.24.1";uses:="org.commonmark,org.commonmark
 .node,org.commonmark.renderer",org.commonmark.renderer.markdown;versi
 on="0.24.1";uses:="org.commonmark,org.commonmark.node,org.commonmark.
 renderer,org.commonmark.text",org.commonmark.renderer.text;version="0
 .24.1";uses:="org.commonmark,org.commonmark.node,org.commonmark.rende
 rer",org.commonmark.text;version="0.24.1"
Import-Package: org.commonmark;version="[0.24,1)",org.commonmark.parse
 r.delimiter;version="[0.24,1)",org.commonmark.renderer;version="[0.24
 ,1)",org.commonmark.text;version="[0.24,1)"
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=11))"
Tool: Bnd-7.0.0.202310060912

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so looks like there's no internal packages there.

Why does it have an Import-Package?

</instructions>
</configuration>
<executions>
<execution>
<id>manifest</id>
<goals>
<goal>manifest</goal>
</goals>
<configuration>
<supportIncrementalBuild>true</supportIncrementalBuild>
</configuration>
</execution>
<execution>
<id>bundle</id>
<goals>
<goal>bundle</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>

Expand Down