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

JOHNZON-398: full JPMS support via module-info.java mechanism #106

Open
wants to merge 1 commit into
base: master
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
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Apache Johnzon
==============

[![Maven](https://github.com/apache/johnzon/actions/workflows/maven.yml/badge.svg)](https://github.com/apache/johnzon/actions/workflows/maven.yml)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.johnzon/johnzon-core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.apache.johnzon/johnzon-core)
[![Javadocs](https://www.javadoc.io/badge/org.apache.johnzon/johnzon-core.svg)](https://www.javadoc.io/doc/org.apache.johnzon/johnzon-core)

Apache Johnzon is a project providing an implementation of JsonProcessing (aka JSR-353) and a set of useful extension for this specification like an Object mapper, some JAX-RS providers and a WebSocket module provides a basic integration with Java WebSocket API (JSR-356).

See the main website: [johnzon.apache.org](https://johnzon.apache.org)

The project Jira: [issues.apache.org/jira/projects/JOHNZON](https://issues.apache.org/jira/projects/JOHNZON).

Artifacts are published to [maven central](https://central.sonatype.dev/publisher/org.apache.johnzon).

```xml
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-core</artifactId>
<version>${johnzon.version}</version>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-jsonp-strict</artifactId>
<version>${johnzon.version}</version>
</dependency>
```
1 change: 0 additions & 1 deletion johnzon-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Automatic-Module-Name>org.apache.johnzon.core</Automatic-Module-Name>
<Require-Capability>osgi.extender;filter:="(osgi.extender=osgi.serviceloader.registrar)"</Require-Capability>
<Provide-Capability>osgi.serviceloader;osgi.serviceloader=jakarta.json.spi.JsonProvider</Provide-Capability>
</instructions>
Expand Down
31 changes: 31 additions & 0 deletions johnzon-core/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
module org.apache.johnzon.core {

requires java.logging;

requires transitive jakarta.json;

exports org.apache.johnzon.core;
exports org.apache.johnzon.core.io;
exports org.apache.johnzon.core.util;

// required due to reflection used in other packages
opens org.apache.johnzon.core to org.apache.johnzon.mapper, org.apache.johnzon.jaxrs, org.apache.johnzon.jsonb;
}
9 changes: 0 additions & 9 deletions johnzon-jaxrs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,6 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Automatic-Module-Name>org.apache.johnzon.jaxrs</Automatic-Module-Name>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down
30 changes: 30 additions & 0 deletions johnzon-jaxrs/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
module org.apache.johnzon.jaxrs {
requires java.logging;

requires transitive jakarta.json;
requires transitive jakarta.ws.rs;
requires transitive java.xml;

requires org.apache.johnzon.mapper;

exports org.apache.johnzon.jaxrs;
exports org.apache.johnzon.jaxrs.xml;
}
25 changes: 25 additions & 0 deletions johnzon-json-extras/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
module org.apache.johnzon.jsonb.extras {

requires transitive jakarta.json;
requires transitive jakarta.json.bind;

exports org.apache.johnzon.jsonb.extras.polymorphism;
}
14 changes: 5 additions & 9 deletions johnzon-jsonb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,18 @@
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>2.1.1</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
Expand Down Expand Up @@ -88,14 +85,14 @@
<dependency>
<groupId>jakarta.interceptor</groupId>
<artifactId>jakarta.interceptor-api</artifactId>
<version>2.1.0</version>
<scope>test</scope>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
<version>2.0.1</version>
<scope>test</scope>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.openwebbeans</groupId>
Expand Down Expand Up @@ -144,9 +141,8 @@
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Automatic-Module-Name>org.apache.johnzon.jsonb</Automatic-Module-Name>
<Import-Package>
javax.ws.rs.*;resolution:=optional,
jakarta.ws.rs.*;resolution:=optional,
*
</Import-Package>
<Require-Capability>
Expand Down
48 changes: 48 additions & 0 deletions johnzon-jsonb/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
module org.apache.johnzon.jsonb {

requires org.apache.johnzon.core;
requires org.apache.johnzon.mapper;

requires java.logging;

requires transitive jakarta.cdi;
requires transitive jakarta.inject;
requires transitive jakarta.interceptor;
requires transitive jakarta.json;
requires transitive jakarta.json.bind;
requires transitive jakarta.ws.rs;

exports org.apache.johnzon.jsonb;
exports org.apache.johnzon.jsonb.adapter;
exports org.apache.johnzon.jsonb.api.experimental;
exports org.apache.johnzon.jsonb.cdi;
exports org.apache.johnzon.jsonb.converter;
exports org.apache.johnzon.jsonb.extension;
exports org.apache.johnzon.jsonb.factory;
exports org.apache.johnzon.jsonb.order;
exports org.apache.johnzon.jsonb.polymorphism;
exports org.apache.johnzon.jsonb.reflect;
exports org.apache.johnzon.jsonb.serializer;
exports org.apache.johnzon.jsonb.spi;

provides jakarta.enterprise.inject.spi.Extension with org.apache.johnzon.jsonb.cdi.JohnzonCdiExtension;
provides jakarta.json.bind.spi.JsonbProvider with org.apache.johnzon.jsonb.JohnzonProvider;
}
9 changes: 0 additions & 9 deletions johnzon-jsonlogic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,6 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Automatic-Module-Name>org.apache.johnzon.jsonlogic</Automatic-Module-Name>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down
24 changes: 24 additions & 0 deletions johnzon-jsonlogic/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
module org.apache.johnzon.jsonlogic {
requires transitive jakarta.json;

exports org.apache.johnzon.jsonlogic;
exports org.apache.johnzon.jsonlogic.spi;
}
9 changes: 0 additions & 9 deletions johnzon-jsonschema/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,6 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Automatic-Module-Name>org.apache.johnzon.jsonschema</Automatic-Module-Name>
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down
33 changes: 33 additions & 0 deletions johnzon-jsonschema/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
module org.apache.johnzon.jsonschema {

requires transitive jakarta.json;
requires transitive jakarta.json.bind;

requires transitive java.scripting;
requires transitive org.jruby.jcodings;
requires transitive org.jruby.joni;

exports org.apache.johnzon.jsonschema;
exports org.apache.johnzon.jsonschema.generator;
exports org.apache.johnzon.jsonschema.regex;
exports org.apache.johnzon.jsonschema.spi;
exports org.apache.johnzon.jsonschema.spi.builtin;
}
7 changes: 4 additions & 3 deletions johnzon-mapper/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@
<dependency>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
<version>3.1.0</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
<version>2.0.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.openjpa</groupId>
<artifactId>openjpa</artifactId>
Expand Down Expand Up @@ -78,7 +80,6 @@
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Automatic-Module-Name>org.apache.johnzon.mapper</Automatic-Module-Name>
<Export-Package>{local-packages};-split-package:=error,org.apache.johnzon.mapper.internal</Export-Package>
</instructions>
</configuration>
Expand Down
Loading