From c1d139eb8a71c14b125518619252aebb1f0e765d Mon Sep 17 00:00:00 2001 From: singingbush Date: Wed, 2 Nov 2022 23:12:22 +0000 Subject: [PATCH 1/4] JOHNZON-305: Add Automatic-Module-Name to manifest --- johnzon-core/pom.xml | 16 ++++++++++++++++ johnzon-jaxrs/pom.xml | 16 ++++++++++++++++ johnzon-jsonb/pom.xml | 16 ++++++++++++++++ johnzon-mapper/pom.xml | 16 ++++++++++++++++ 4 files changed, 64 insertions(+) diff --git a/johnzon-core/pom.xml b/johnzon-core/pom.xml index e17434d7..ce5e3df3 100644 --- a/johnzon-core/pom.xml +++ b/johnzon-core/pom.xml @@ -35,6 +35,22 @@ + + org.apache.maven.plugins + maven-jar-plugin + + + default-jar + + + + johnzon.core + + + + + + org.apache.felix maven-bundle-plugin diff --git a/johnzon-jaxrs/pom.xml b/johnzon-jaxrs/pom.xml index c408766c..780bb34b 100644 --- a/johnzon-jaxrs/pom.xml +++ b/johnzon-jaxrs/pom.xml @@ -65,6 +65,22 @@ + + org.apache.maven.plugins + maven-jar-plugin + + + default-jar + + + + johnzon.jaxrs + + + + + + org.apache.maven.plugins maven-shade-plugin diff --git a/johnzon-jsonb/pom.xml b/johnzon-jsonb/pom.xml index 7bcfd30b..e2eb5fe4 100644 --- a/johnzon-jsonb/pom.xml +++ b/johnzon-jsonb/pom.xml @@ -135,6 +135,22 @@ + + org.apache.maven.plugins + maven-jar-plugin + + + default-jar + + + + johnzon.jsonb + + + + + + org.apache.maven.plugins maven-shade-plugin diff --git a/johnzon-mapper/pom.xml b/johnzon-mapper/pom.xml index 312b5343..be508d59 100644 --- a/johnzon-mapper/pom.xml +++ b/johnzon-mapper/pom.xml @@ -73,6 +73,22 @@ + + org.apache.maven.plugins + maven-jar-plugin + + + default-jar + + + + johnzon.mapper + + + + + + org.apache.felix maven-bundle-plugin From 649638700c1814b644bca996da0c3821ed91f209 Mon Sep 17 00:00:00 2001 From: singingbush Date: Thu, 26 Jan 2023 00:40:14 +0000 Subject: [PATCH 2/4] JOHNZON-305: core and jaxrs now use module-info --- johnzon-core/pom.xml | 16 --------- johnzon-core/src/main/java/module-info.java | 27 ++++++++++++++++ johnzon-jaxrs/pom.xml | 16 --------- johnzon-jaxrs/src/main/java/module-info.java | 32 ++++++++++++++++++ johnzon-websocket/pom.xml | 34 ++++++++++++++------ pom.xml | 1 + 6 files changed, 85 insertions(+), 41 deletions(-) create mode 100644 johnzon-core/src/main/java/module-info.java create mode 100644 johnzon-jaxrs/src/main/java/module-info.java diff --git a/johnzon-core/pom.xml b/johnzon-core/pom.xml index ce5e3df3..e17434d7 100644 --- a/johnzon-core/pom.xml +++ b/johnzon-core/pom.xml @@ -35,22 +35,6 @@ - - org.apache.maven.plugins - maven-jar-plugin - - - default-jar - - - - johnzon.core - - - - - - org.apache.felix maven-bundle-plugin 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..ae269289 --- /dev/null +++ b/johnzon-core/src/main/java/module-info.java @@ -0,0 +1,27 @@ +/* + * 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 johnzon.core { + requires java.logging; + + requires jakarta.json; + + exports org.apache.johnzon.core; + + provides jakarta.json.spi.JsonProvider with org.apache.johnzon.core.JsonProviderImpl; +} \ No newline at end of file diff --git a/johnzon-jaxrs/pom.xml b/johnzon-jaxrs/pom.xml index 780bb34b..c408766c 100644 --- a/johnzon-jaxrs/pom.xml +++ b/johnzon-jaxrs/pom.xml @@ -65,22 +65,6 @@ - - org.apache.maven.plugins - maven-jar-plugin - - - default-jar - - - - 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..441a8c68 --- /dev/null +++ b/johnzon-jaxrs/src/main/java/module-info.java @@ -0,0 +1,32 @@ +/* + * 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 johnzon.jaxrs { + requires java.xml; + + requires jakarta.ws.rs; + requires jakarta.json; + + requires johnzon.core; + requires johnzon.mapper; + + exports org.apache.johnzon.jaxrs; + exports org.apache.johnzon.jaxrs.xml; + + opens org.apache.johnzon.jaxrs to johnzon.mapper; +} \ No newline at end of file diff --git a/johnzon-websocket/pom.xml b/johnzon-websocket/pom.xml index d8adbf69..5ac62dec 100644 --- a/johnzon-websocket/pom.xml +++ b/johnzon-websocket/pom.xml @@ -144,15 +144,31 @@ - - org.apache.maven.plugins - maven-surefire-plugin - - - https://repo1.maven.org/maven2/ - - - + + org.apache.maven.plugins + maven-jar-plugin + + + default-jar + + + + johnzon.websocket + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + https://repo1.maven.org/maven2/ + + + org.apache.maven.plugins maven-shade-plugin diff --git a/pom.xml b/pom.xml index 521f2d10..86e68aa2 100644 --- a/pom.xml +++ b/pom.xml @@ -304,6 +304,7 @@ UTF-8 + **/module-info* true true true From d377c57846973bb1c3836ff80499a1636ca2df71 Mon Sep 17 00:00:00 2001 From: singingbush Date: Thu, 26 Jan 2023 01:52:10 +0000 Subject: [PATCH 3/4] configure Automatic-Module-Name in other modules --- johnzon-jsonb/pom.xml | 17 +---------------- johnzon-jsonlogic/pom.xml | 9 +++++++++ johnzon-jsonschema/pom.xml | 9 +++++++++ johnzon-mapper/pom.xml | 17 +---------------- johnzon-websocket/pom.xml | 25 +++++++++---------------- 5 files changed, 29 insertions(+), 48 deletions(-) diff --git a/johnzon-jsonb/pom.xml b/johnzon-jsonb/pom.xml index e2eb5fe4..e0a3815b 100644 --- a/johnzon-jsonb/pom.xml +++ b/johnzon-jsonb/pom.xml @@ -135,22 +135,6 @@ - - org.apache.maven.plugins - maven-jar-plugin - - - default-jar - - - - johnzon.jsonb - - - - - - org.apache.maven.plugins maven-shade-plugin @@ -160,6 +144,7 @@ maven-bundle-plugin + johnzon.jsonb javax.ws.rs.*;resolution:=optional, * diff --git a/johnzon-jsonlogic/pom.xml b/johnzon-jsonlogic/pom.xml index 48cffa60..dec52696 100644 --- a/johnzon-jsonlogic/pom.xml +++ b/johnzon-jsonlogic/pom.xml @@ -40,6 +40,15 @@ + + org.apache.felix + maven-bundle-plugin + + + johnzon.jsonlogic + + + org.apache.maven.plugins maven-shade-plugin diff --git a/johnzon-jsonschema/pom.xml b/johnzon-jsonschema/pom.xml index 21347f86..14a35228 100644 --- a/johnzon-jsonschema/pom.xml +++ b/johnzon-jsonschema/pom.xml @@ -54,6 +54,15 @@ + + org.apache.felix + maven-bundle-plugin + + + johnzon.jsonschema + + + org.apache.maven.plugins maven-shade-plugin diff --git a/johnzon-mapper/pom.xml b/johnzon-mapper/pom.xml index be508d59..a6811627 100644 --- a/johnzon-mapper/pom.xml +++ b/johnzon-mapper/pom.xml @@ -73,27 +73,12 @@ - - org.apache.maven.plugins - maven-jar-plugin - - - default-jar - - - - johnzon.mapper - - - - - - org.apache.felix maven-bundle-plugin + johnzon.mapper {local-packages};-split-package:=error,org.apache.johnzon.mapper.internal diff --git a/johnzon-websocket/pom.xml b/johnzon-websocket/pom.xml index 5ac62dec..2f32ac68 100644 --- a/johnzon-websocket/pom.xml +++ b/johnzon-websocket/pom.xml @@ -144,22 +144,6 @@ - - org.apache.maven.plugins - maven-jar-plugin - - - default-jar - - - - johnzon.websocket - - - - - - org.apache.maven.plugins maven-surefire-plugin @@ -169,6 +153,15 @@ + + org.apache.felix + maven-bundle-plugin + + + johnzon.websocket + + + org.apache.maven.plugins maven-shade-plugin From f777d7526ce5086cfb276179b2b8253f1ec627ae Mon Sep 17 00:00:00 2001 From: singingbush Date: Fri, 27 Jan 2023 09:01:15 +0000 Subject: [PATCH 4/4] set Automatic-Module-Name using bundle plugin --- johnzon-core/pom.xml | 1 + johnzon-core/src/main/java/module-info.java | 27 ----------------- johnzon-jaxrs/pom.xml | 9 ++++++ johnzon-jaxrs/src/main/java/module-info.java | 32 -------------------- johnzon-jsonb/pom.xml | 2 +- johnzon-jsonlogic/pom.xml | 2 +- johnzon-jsonschema/pom.xml | 2 +- johnzon-mapper/pom.xml | 2 +- johnzon-websocket/pom.xml | 2 +- 9 files changed, 15 insertions(+), 64 deletions(-) delete mode 100644 johnzon-core/src/main/java/module-info.java delete mode 100644 johnzon-jaxrs/src/main/java/module-info.java diff --git a/johnzon-core/pom.xml b/johnzon-core/pom.xml index e17434d7..00cf51c4 100644 --- a/johnzon-core/pom.xml +++ b/johnzon-core/pom.xml @@ -40,6 +40,7 @@ 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 deleted file mode 100644 index ae269289..00000000 --- a/johnzon-core/src/main/java/module-info.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 johnzon.core { - requires java.logging; - - requires jakarta.json; - - exports org.apache.johnzon.core; - - provides jakarta.json.spi.JsonProvider with org.apache.johnzon.core.JsonProviderImpl; -} \ No newline at end of file diff --git a/johnzon-jaxrs/pom.xml b/johnzon-jaxrs/pom.xml index c408766c..3ca4a654 100644 --- a/johnzon-jaxrs/pom.xml +++ b/johnzon-jaxrs/pom.xml @@ -65,6 +65,15 @@ + + 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 deleted file mode 100644 index 441a8c68..00000000 --- a/johnzon-jaxrs/src/main/java/module-info.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 johnzon.jaxrs { - requires java.xml; - - requires jakarta.ws.rs; - requires jakarta.json; - - requires johnzon.core; - requires johnzon.mapper; - - exports org.apache.johnzon.jaxrs; - exports org.apache.johnzon.jaxrs.xml; - - opens org.apache.johnzon.jaxrs to johnzon.mapper; -} \ No newline at end of file diff --git a/johnzon-jsonb/pom.xml b/johnzon-jsonb/pom.xml index e0a3815b..5ad89d04 100644 --- a/johnzon-jsonb/pom.xml +++ b/johnzon-jsonb/pom.xml @@ -144,7 +144,7 @@ maven-bundle-plugin - johnzon.jsonb + org.apache.johnzon.jsonb javax.ws.rs.*;resolution:=optional, * diff --git a/johnzon-jsonlogic/pom.xml b/johnzon-jsonlogic/pom.xml index dec52696..e2a47521 100644 --- a/johnzon-jsonlogic/pom.xml +++ b/johnzon-jsonlogic/pom.xml @@ -45,7 +45,7 @@ maven-bundle-plugin - johnzon.jsonlogic + org.apache.johnzon.jsonlogic diff --git a/johnzon-jsonschema/pom.xml b/johnzon-jsonschema/pom.xml index 14a35228..d4e65049 100644 --- a/johnzon-jsonschema/pom.xml +++ b/johnzon-jsonschema/pom.xml @@ -59,7 +59,7 @@ maven-bundle-plugin - johnzon.jsonschema + org.apache.johnzon.jsonschema diff --git a/johnzon-mapper/pom.xml b/johnzon-mapper/pom.xml index a6811627..c4666137 100644 --- a/johnzon-mapper/pom.xml +++ b/johnzon-mapper/pom.xml @@ -78,7 +78,7 @@ maven-bundle-plugin - johnzon.mapper + org.apache.johnzon.mapper {local-packages};-split-package:=error,org.apache.johnzon.mapper.internal diff --git a/johnzon-websocket/pom.xml b/johnzon-websocket/pom.xml index 2f32ac68..a86963ea 100644 --- a/johnzon-websocket/pom.xml +++ b/johnzon-websocket/pom.xml @@ -158,7 +158,7 @@ maven-bundle-plugin - johnzon.websocket + org.apache.johnzon.websocket