Skip to content
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

Fully automate OSGi metadata creation and implement minor fixes #327

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions integration/pom.xml
Expand Up @@ -22,6 +22,7 @@
<!-- 1.9.1 does not work. Do not update lightly -->
<ant-junit.version>1.9.0</ant-junit.version>
<antrun-plugin.version>1.8</antrun-plugin.version>
<bnd.skip>true</bnd.skip>
</properties>


Expand Down
Empty file.
14 changes: 14 additions & 0 deletions jcl-over-slf4j/pom.xml
Expand Up @@ -39,5 +39,19 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>

<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<bnd><![CDATA[
-exportcontents: org.apache.commons.logging.*;version=${jcl.version}
]]></bnd>
</configuration>
</plugin>

</plugins>
</build>
</project>
9 changes: 0 additions & 9 deletions jcl-over-slf4j/src/main/resources/META-INF/MANIFEST.MF

This file was deleted.

16 changes: 16 additions & 0 deletions jul-to-slf4j/pom.xml
Expand Up @@ -31,4 +31,20 @@
</dependency>
</dependencies>

<build>
<plugins>

<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<bnd><![CDATA[
Automatic-Module-Name: ${bsn}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead of adding Automatic-Module-Name headers, wouldn't it be better to add a regular modules-info.java?
This question applies for the other artifacts, where I added that header as well.

]]></bnd>
</configuration>
</plugin>

</plugins>
</build>

</project>
8 changes: 0 additions & 8 deletions jul-to-slf4j/src/main/resources/META-INF/MANIFEST.MF

This file was deleted.

17 changes: 17 additions & 0 deletions log4j-over-slf4j/pom.xml
Expand Up @@ -41,4 +41,21 @@
</dependency>
</dependencies>

<build>
<plugins>

<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<bnd><![CDATA[
Import-Package: org.slf4j.*;version="${range;[===,3);${slf4j.api.minimum.compatible.version}}"
Export-Package: org.apache.log4j.*;version=${reload4j.version}
]]></bnd>
</configuration>
</plugin>

</plugins>
</build>

</project>
13 changes: 0 additions & 13 deletions log4j-over-slf4j/src/main/resources/META-INF/MANIFEST.MF

This file was deleted.

23 changes: 22 additions & 1 deletion osgi-over-slf4j/pom.xml
Expand Up @@ -37,8 +37,29 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>

<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<bnd><![CDATA[
Bundle-SymbolicName: org.slf4j.osgi-over-slf4j
Import-Package: org.slf4j.*, *
-exportcontents:
Bundle-Activator: org.slf4j.osgi.logservice.impl.Activator
Bundle-Category: osgi
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is that header necessary?

Automatic-Module-Name: ${bsn}
]]></bnd>
</configuration>
</plugin>

</plugins>
</build>

</project>
8 changes: 0 additions & 8 deletions osgi-over-slf4j/src/main/resources/META-INF/MANIFEST.MF

This file was deleted.

117 changes: 57 additions & 60 deletions pom.xml
Expand Up @@ -30,13 +30,13 @@
<scm>
<url>https://github.com/qos-ch/slf4j</url>
<connection>scm:git:https://github.com/qos-ch/slf4j.git</connection>
</scm>
</scm>

<properties>
<!-- yyyy-MM-dd'T'HH:mm:ss'Z' -->
<project.build.outputTimestamp>2022-12-12T19:19:39Z</project.build.outputTimestamp>
<project.build.outputTimestamp>2022-12-12T19:19:39Z</project.build.outputTimestamp>
<latest.stable.version>1.7.36</latest.stable.version>
<latest.2.version>2.0.0-alpha7</latest.2.version>
<latest.2.version>2.0.0-alpha7</latest.2.version>
<!-- java.util.ServiceLoader requires Java 6 -->
<jdk.version>8</jdk.version>
<maven.compiler.source>${jdk.version}</maven.compiler.source>
Expand All @@ -47,8 +47,9 @@
<!-- used in integration testing -->
<slf4j.api.minimum.compatible.version>1.6.0</slf4j.api.minimum.compatible.version>
<cal10n.version>0.8.1</cal10n.version>
<reload4j.version>1.2.22</reload4j.version>
<reload4j.version>1.2.22</reload4j.version>
<logback.version>1.2.10</logback.version>
<jcl.version>1.2</jcl.version>
<junit.version>4.13.1</junit.version>
<maven-site-plugin.version>3.7.1</maven-site-plugin.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
Expand All @@ -58,9 +59,7 @@
<maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
<maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
<maven-jxr-plugin.version>3.1.1</maven-jxr-plugin.version>
<maven-bundle-plugin.version>5.1.8</maven-bundle-plugin.version>
<build-helper-maven-plugin.version>3.2.0</build-helper-maven-plugin.version>

<bnd.version>6.4.0</bnd.version>
</properties>

<developers>
Expand All @@ -78,7 +77,7 @@
<module>slf4j-jdk14</module>
<module>slf4j-jdk-platform-logging</module>
<module>slf4j-log4j12</module>
<module>slf4j-reload4j</module>
<module>slf4j-reload4j</module>
<module>slf4j-ext</module>
<module>jcl-over-slf4j</module>
<module>log4j-over-slf4j</module>
Expand All @@ -96,6 +95,12 @@
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>biz.aQute.bnd</groupId>
<artifactId>biz.aQute.bnd.annotation</artifactId>
<version>${bnd.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>

<dependencyManagement>
Expand All @@ -113,7 +118,6 @@
<version>${project.version}</version>
</dependency>


<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
Expand All @@ -125,7 +129,7 @@
<artifactId>reload4j</artifactId>
<version>${reload4j.version}</version>
</dependency>

<dependency>
<groupId>ch.qos.cal10n</groupId>
<artifactId>cal10n-api</artifactId>
Expand Down Expand Up @@ -192,14 +196,14 @@
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</execution>
</execution>

<execution>
<execution>
<id>module-compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</goals>
<configuration>
<release>9</release>
<compileSourceRoots>
Expand All @@ -209,8 +213,6 @@
</configuration>
</execution>



</executions>

</plugin>
Expand Down Expand Up @@ -238,27 +240,39 @@
</plugin>

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${maven-bundle-plugin.version}</version>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<version>${bnd.version}</version>
<configuration>
<!-- populated by the plugin itself -->
<bnd><![CDATA[
# Use $[ .. ] to defer variable subtitution to bnd to not get this parent's values

Bundle-SymbolicName: ${replacestring;${project.artifactId};-;.}
Bundle-Name: $[project.artifactId]
Bundle-Vendor: SLF4J.ORG
-snapshot:

Import-Package: org.slf4j.*
-exportcontents: org.slf4j.*

X-Compile-Source-JDK: ${maven.compiler.source}
X-Compile-Target-JDK: ${maven.compiler.target}
Implementation-Version: ${project.version}
Implementation-Title: $[project.artifactId]
Comment on lines +259 to +262
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does anybody know for what those are used?

Multi-Release: true

-removeheaders: Private-Package,Bundle-SCM, Bundle-Developers, Include-Resource
-fixupmessages: 'Classes found in the wrong directory: .*'
]]></bnd>
</configuration>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
<goal>bnd-process</goal>
</goals>
<configuration>
<instructions>
<!-- populated by the plugin itself -->
<Bundle-Version>${parsedVersion.osgiVersion}</Bundle-Version>
<Bundle-Description>${project.description}</Bundle-Description>
<X-Compile-Source-JDK>${maven.compiler.source}</X-Compile-Source-JDK>
<X-Compile-Target-JDK>${maven.compiler.target}</X-Compile-Target-JDK>
<Implementation-Version>${project.version}</Implementation-Version>
<Multi-Release>true</Multi-Release>
</instructions>
</configuration>
</execution>
</executions>
</plugin>
Expand Down Expand Up @@ -293,21 +307,6 @@
</executions>
</plugin>

<!-- as suggested in http://jira.qos.ch/browse/SLF4J-143 -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${build-helper-maven-plugin.version}</version>
<executions>
<execution>
<id>parse-version</id>
<goals>
<goal>parse-version</goal>
</goals>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
Expand All @@ -319,8 +318,8 @@
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>

</plugins>

</build>

<reporting>
Expand All @@ -335,7 +334,7 @@
<linkJavadoc>true</linkJavadoc>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand Down Expand Up @@ -382,7 +381,7 @@
</groups>
</configuration>
</plugin>

</plugins>
</reporting>

Expand Down Expand Up @@ -450,8 +449,7 @@
</plugins>
</build>

<pluginRepositories>
</pluginRepositories>
<pluginRepositories />
</profile>

<profile>
Expand Down Expand Up @@ -506,16 +504,15 @@

<pluginRepositories>
<pluginRepository>
<id>apache-snapshot-repo</id>
<name>apache-snapshot-repo</name>
<url>https://repository.apache.org/content/groups/snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>

<id>apache-snapshot-repo</id>
<name>apache-snapshot-repo</name>
<url>https://repository.apache.org/content/groups/snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

Expand Down