Skip to content

Commit

Permalink
Add minimal OSGi metadata as per #768 (#805)
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder authored Aug 2, 2022
1 parent bc48353 commit a0f45a1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@
still use Moditect to get JDK9+ module info support; need newer bundle plugin as well
(can just defaults from `jackson-parent`)
-->

<osgi.export>com.fasterxml.jackson.core;version=${project.version},
com.fasterxml.jackson.core.*;version=${project.version}
</osgi.export>

<!-- Generate PackageVersion.java into this directory. -->
<packageVersion.dir>com/fasterxml/jackson/core/json</packageVersion.dir>
<packageVersion.package>${project.groupId}.json</packageVersion.package>

<!-- Bnd annotations for generating extra OSGi metadata. -->
<version.bnd.annotation>6.3.1</version.bnd.annotation>
</properties>

<!-- Alas, need to include snapshot reference since otherwise can not find
Expand Down Expand Up @@ -142,6 +144,16 @@ com.fasterxml.jackson.core.*;version=${project.version}
</build>

<dependencies>
<!-- 31-Jul-2022, tatu: [core#768] OSGi metadata -->
<dependency>
<groupId>biz.aQute.bnd</groupId>
<artifactId>biz.aQute.bnd.annotation</artifactId>
<version>${version.bnd.annotation}</version>
<optional>true</optional>
<scope>provided</scope>
</dependency>

<!-- plus test dependencies -->
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/fasterxml/jackson/core/JsonFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import java.lang.ref.SoftReference;
import java.net.URL;

import aQute.bnd.annotation.spi.ServiceProvider;

import com.fasterxml.jackson.core.format.InputAccessor;
import com.fasterxml.jackson.core.format.MatchStrength;
import com.fasterxml.jackson.core.io.*;
Expand Down Expand Up @@ -42,6 +44,7 @@
* @author Tatu Saloranta
*/
@SuppressWarnings("resource")
@ServiceProvider(JsonFactory.class) // will be `TokenStreamFactory` in 3.x
public class JsonFactory
extends TokenStreamFactory
implements Versioned,
Expand Down

0 comments on commit a0f45a1

Please sign in to comment.