diff --git a/README.md b/README.md new file mode 100644 index 00000000..63440b51 --- /dev/null +++ b/README.md @@ -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 + + org.apache.johnzon + johnzon-core + ${johnzon.version} + + + org.apache.johnzon + johnzon-jsonp-strict + ${johnzon.version} + +``` \ No newline at end of file diff --git a/johnzon-core/pom.xml b/johnzon-core/pom.xml index 00cf51c4..e17434d7 100644 --- a/johnzon-core/pom.xml +++ b/johnzon-core/pom.xml @@ -40,7 +40,6 @@ maven-bundle-plugin - org.apache.johnzon.core osgi.extender;filter:="(osgi.extender=osgi.serviceloader.registrar)" osgi.serviceloader;osgi.serviceloader=jakarta.json.spi.JsonProvider diff --git a/johnzon-core/src/main/java/module-info.java b/johnzon-core/src/main/java/module-info.java new file mode 100644 index 00000000..5b3c85d5 --- /dev/null +++ b/johnzon-core/src/main/java/module-info.java @@ -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; +} \ No newline at end of file diff --git a/johnzon-jaxrs/pom.xml b/johnzon-jaxrs/pom.xml index 3ca4a654..c408766c 100644 --- a/johnzon-jaxrs/pom.xml +++ b/johnzon-jaxrs/pom.xml @@ -65,15 +65,6 @@ - - org.apache.felix - maven-bundle-plugin - - - org.apache.johnzon.jaxrs - - - org.apache.maven.plugins maven-shade-plugin diff --git a/johnzon-jaxrs/src/main/java/module-info.java b/johnzon-jaxrs/src/main/java/module-info.java new file mode 100644 index 00000000..36dd3151 --- /dev/null +++ b/johnzon-jaxrs/src/main/java/module-info.java @@ -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; +} \ No newline at end of file diff --git a/johnzon-json-extras/src/main/java/module-info.java b/johnzon-json-extras/src/main/java/module-info.java new file mode 100644 index 00000000..9ed61cd7 --- /dev/null +++ b/johnzon-json-extras/src/main/java/module-info.java @@ -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; +} \ No newline at end of file diff --git a/johnzon-jsonb/pom.xml b/johnzon-jsonb/pom.xml index 5ad89d04..b027a2bc 100644 --- a/johnzon-jsonb/pom.xml +++ b/johnzon-jsonb/pom.xml @@ -37,21 +37,18 @@ jakarta.annotation jakarta.annotation-api - 2.1.1 provided true jakarta.ws.rs jakarta.ws.rs-api - 3.1.0 provided true jakarta.enterprise jakarta.enterprise.cdi-api - 4.0.1 provided true @@ -88,14 +85,14 @@ jakarta.interceptor jakarta.interceptor-api - 2.1.0 - test + provided + true jakarta.inject jakarta.inject-api - 2.0.1 - test + provided + true org.apache.openwebbeans @@ -144,9 +141,8 @@ maven-bundle-plugin - org.apache.johnzon.jsonb - javax.ws.rs.*;resolution:=optional, + jakarta.ws.rs.*;resolution:=optional, * diff --git a/johnzon-jsonb/src/main/java/module-info.java b/johnzon-jsonb/src/main/java/module-info.java new file mode 100644 index 00000000..de39ea53 --- /dev/null +++ b/johnzon-jsonb/src/main/java/module-info.java @@ -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; +} \ No newline at end of file diff --git a/johnzon-jsonlogic/pom.xml b/johnzon-jsonlogic/pom.xml index e2a47521..48cffa60 100644 --- a/johnzon-jsonlogic/pom.xml +++ b/johnzon-jsonlogic/pom.xml @@ -40,15 +40,6 @@ - - org.apache.felix - maven-bundle-plugin - - - org.apache.johnzon.jsonlogic - - - org.apache.maven.plugins maven-shade-plugin diff --git a/johnzon-jsonlogic/src/main/java/module-info.java b/johnzon-jsonlogic/src/main/java/module-info.java new file mode 100644 index 00000000..8ef47c15 --- /dev/null +++ b/johnzon-jsonlogic/src/main/java/module-info.java @@ -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; +} \ No newline at end of file diff --git a/johnzon-jsonschema/pom.xml b/johnzon-jsonschema/pom.xml index d4e65049..21347f86 100644 --- a/johnzon-jsonschema/pom.xml +++ b/johnzon-jsonschema/pom.xml @@ -54,15 +54,6 @@ - - org.apache.felix - maven-bundle-plugin - - - org.apache.johnzon.jsonschema - - - org.apache.maven.plugins maven-shade-plugin diff --git a/johnzon-jsonschema/src/main/java/module-info.java b/johnzon-jsonschema/src/main/java/module-info.java new file mode 100644 index 00000000..2613e7c2 --- /dev/null +++ b/johnzon-jsonschema/src/main/java/module-info.java @@ -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; +} \ No newline at end of file diff --git a/johnzon-mapper/pom.xml b/johnzon-mapper/pom.xml index d808dcad..76eaecf1 100644 --- a/johnzon-mapper/pom.xml +++ b/johnzon-mapper/pom.xml @@ -38,13 +38,15 @@ jakarta.persistence jakarta.persistence-api - 3.1.0 + test + jakarta.transaction jakarta.transaction-api - 2.0.1 + test + org.apache.openjpa openjpa @@ -78,7 +80,6 @@ maven-bundle-plugin - org.apache.johnzon.mapper {local-packages};-split-package:=error,org.apache.johnzon.mapper.internal diff --git a/johnzon-mapper/src/main/java/module-info.java b/johnzon-mapper/src/main/java/module-info.java new file mode 100644 index 00000000..513f5a1d --- /dev/null +++ b/johnzon-mapper/src/main/java/module-info.java @@ -0,0 +1,35 @@ +/* + * 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.mapper { + + requires org.apache.johnzon.core; + requires java.desktop; // for java.beans + + requires jakarta.json; + + exports org.apache.johnzon.mapper; + exports org.apache.johnzon.mapper.access; + exports org.apache.johnzon.mapper.converter; + exports org.apache.johnzon.mapper.jsonp; + exports org.apache.johnzon.mapper.map; + exports org.apache.johnzon.mapper.reflection; + exports org.apache.johnzon.mapper.util; + + exports org.apache.johnzon.mapper.internal to org.apache.johnzon.jaxrs, org.apache.johnzon.jsonb; +} \ No newline at end of file diff --git a/johnzon-websocket/pom.xml b/johnzon-websocket/pom.xml index a86963ea..5e04549b 100644 --- a/johnzon-websocket/pom.xml +++ b/johnzon-websocket/pom.xml @@ -148,20 +148,12 @@ org.apache.maven.plugins maven-surefire-plugin + false https://repo1.maven.org/maven2/ - - org.apache.felix - maven-bundle-plugin - - - org.apache.johnzon.websocket - - - org.apache.maven.plugins maven-shade-plugin diff --git a/johnzon-websocket/src/main/java/module-info.java b/johnzon-websocket/src/main/java/module-info.java new file mode 100644 index 00000000..07eb7f48 --- /dev/null +++ b/johnzon-websocket/src/main/java/module-info.java @@ -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.websocket { + requires transitive org.apache.johnzon.mapper; + + requires transitive jakarta.websocket.client; + requires transitive jakarta.websocket; + requires transitive jakarta.servlet; + requires transitive jakarta.json; + requires transitive jakarta.json.bind; + + exports org.apache.johnzon.websocket.jsonb; + exports org.apache.johnzon.websocket.jsr; + exports org.apache.johnzon.websocket.mapper; +} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 60ff841c..617795ee 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,6 @@ UTF-8 UTF-8 - 10 2.1.1 3.0.0 @@ -72,6 +71,33 @@ + + jakarta.annotation + jakarta.annotation-api + 2.1.1 + + + jakarta.persistence + jakarta.persistence-api + 3.1.0 + + + jakarta.transaction + jakarta.transaction-api + 2.0.1 + + + jakarta.interceptor + jakarta.interceptor-api + 2.1.0 + provided + + + jakarta.inject + jakarta.inject-api + 2.0.1 + provided + jakarta.json jakarta.json-api @@ -84,6 +110,16 @@ ${jakarta-jsonb-api.version} provided + + jakarta.ws.rs + jakarta.ws.rs-api + 3.1.0 + + + jakarta.enterprise + jakarta.enterprise.cdi-api + 4.0.1 + junit junit @@ -113,32 +149,32 @@ org.apache.maven.plugins maven-compiler-plugin - 3.10.1 + 3.11.0 org.apache.maven.plugins maven-source-plugin - 3.2.1 + 3.3.0 org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 + 3.5.0 org.apache.maven.plugins maven-enforcer-plugin - 3.1.0 + 3.3.0 org.apache.maven.plugins maven-surefire-plugin - 3.0.0 + 3.1.0 org.apache.maven.plugins maven-surefire-report-plugin - 3.0.0-M7 + 3.1.2 org.apache.maven.plugins @@ -148,7 +184,7 @@ org.apache.maven.plugins maven-release-plugin - 3.0.0-M6 + 3.0.1 org.apache.maven.plugins @@ -164,17 +200,17 @@ org.apache.maven.plugins maven-pmd-plugin - 3.19.0 + 3.21.0 org.apache.maven.plugins maven-project-info-reports-plugin - 3.4.1 + 3.4.5 org.codehaus.mojo versions-maven-plugin - 2.14.2 + 2.16.0 org.codehaus.mojo @@ -210,6 +246,8 @@ true true true + + false @@ -415,7 +453,7 @@ jar - private + protected false false false @@ -432,6 +470,7 @@ ${surefire.jvm.params} false + false