[johnzon] branch master updated: JOHNZON-359 Fix lost OSGi metadata (#78)

2022-02-20 Thread rmannibucau
This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/johnzon.git


The following commit(s) were added to refs/heads/master by this push:
 new 6b37e52  JOHNZON-359 Fix lost OSGi metadata (#78)
6b37e52 is described below

commit 6b37e521f9c50e76a269a9846d122d423d9a9de1
Author: Raymond Augé 
AuthorDate: Sun Feb 20 12:32:14 2022 -0500

JOHNZON-359 Fix lost OSGi metadata (#78)

Reverts the packaging change from b221d9db923c142afcddde056abd9301acbf9af1

Signed-off-by: Raymond Augé 
---
 johnzon-core/pom.xml | 1 +
 johnzon-json-extras/pom.xml  | 1 +
 johnzon-jsonb/pom.xml| 2 +-
 johnzon-jsonlogic/pom.xml| 2 +-
 johnzon-jsonp-strict/pom.xml | 2 +-
 johnzon-mapper/pom.xml   | 1 +
 johnzon-osgi/pom.xml | 4 ++--
 7 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/johnzon-core/pom.xml b/johnzon-core/pom.xml
index 56f0e98..8273fd0 100644
--- a/johnzon-core/pom.xml
+++ b/johnzon-core/pom.xml
@@ -27,6 +27,7 @@
 
   johnzon-core
   Johnzon :: Core
+  bundle
 
   
 
${project.parent.reporting.outputDirectory}
diff --git a/johnzon-json-extras/pom.xml b/johnzon-json-extras/pom.xml
index 030ab6a..e311560 100644
--- a/johnzon-json-extras/pom.xml
+++ b/johnzon-json-extras/pom.xml
@@ -27,6 +27,7 @@
 
   johnzon-jsonb-extras
   Johnzon :: JSON-B Extensions
+  bundle
 
   
 
${project.parent.reporting.outputDirectory}
diff --git a/johnzon-jsonb/pom.xml b/johnzon-jsonb/pom.xml
index 97b7a45..8a7bdf1 100644
--- a/johnzon-jsonb/pom.xml
+++ b/johnzon-jsonb/pom.xml
@@ -27,7 +27,7 @@
 
   johnzon-jsonb
   Johnzon :: JSON-B Implementation
-
+  bundle
 
   
 
${project.parent.reporting.outputDirectory}
diff --git a/johnzon-jsonlogic/pom.xml b/johnzon-jsonlogic/pom.xml
index 33beb03..12e266d 100644
--- a/johnzon-jsonlogic/pom.xml
+++ b/johnzon-jsonlogic/pom.xml
@@ -27,7 +27,7 @@
 
   johnzon-jsonlogic
   Johnzon :: JSON Logic
-
+  bundle
 
   
 
diff --git a/johnzon-jsonp-strict/pom.xml b/johnzon-jsonp-strict/pom.xml
index 6acd306..55029a8 100644
--- a/johnzon-jsonp-strict/pom.xml
+++ b/johnzon-jsonp-strict/pom.xml
@@ -27,7 +27,7 @@
 
   johnzon-jsonp-strict
   Johnzon :: JSON-P Strict JSON Pointer Implementation (spec 
compliant)
-
+  bundle
 
   
 
${project.parent.reporting.outputDirectory}
diff --git a/johnzon-mapper/pom.xml b/johnzon-mapper/pom.xml
index 0c1bf54..72aa972 100644
--- a/johnzon-mapper/pom.xml
+++ b/johnzon-mapper/pom.xml
@@ -70,6 +70,7 @@
   
 
${project.parent.reporting.outputDirectory}
   
+  bundle
 
   
 
diff --git a/johnzon-osgi/pom.xml b/johnzon-osgi/pom.xml
index c462fb8..2dfdbbd 100644
--- a/johnzon-osgi/pom.xml
+++ b/johnzon-osgi/pom.xml
@@ -27,7 +27,7 @@
 
   johnzon-osgi
   Johnzon :: Support for OSGI Jaxrs Whiteboard
-
+  bundle
 
   
 
@@ -128,4 +128,4 @@
   
 
   
-
+
\ No newline at end of file


[johnzon] branch master updated: JOHNZON-362 johnzon maven plugin tests fail on windows (#81)

2022-02-20 Thread rmannibucau
This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/johnzon.git


The following commit(s) were added to refs/heads/master by this push:
 new 48a6c5f  JOHNZON-362 johnzon maven plugin tests fail on windows (#81)
48a6c5f is described below

commit 48a6c5f60ad891b4118edf40ffc2e7eb7789ada9
Author: Raymond Augé 
AuthorDate: Sun Feb 20 12:30:54 2022 -0500

JOHNZON-362 johnzon maven plugin tests fail on windows (#81)

Signed-off-by: Raymond Augé 
---
 .../johnzon/maven/plugin/ExampleToModelMojo.java   |  6 ++-
 .../maven/plugin/ExampleToModelMojoTest.java   | 43 ++
 2 files changed, 39 insertions(+), 10 deletions(-)

diff --git 
a/johnzon-maven-plugin/src/main/java/org/apache/johnzon/maven/plugin/ExampleToModelMojo.java
 
b/johnzon-maven-plugin/src/main/java/org/apache/johnzon/maven/plugin/ExampleToModelMojo.java
index af34fbd..03c7ff7 100644
--- 
a/johnzon-maven-plugin/src/main/java/org/apache/johnzon/maven/plugin/ExampleToModelMojo.java
+++ 
b/johnzon-maven-plugin/src/main/java/org/apache/johnzon/maven/plugin/ExampleToModelMojo.java
@@ -18,6 +18,7 @@
  */
 package org.apache.johnzon.maven.plugin;
 
+import static java.nio.charset.StandardCharsets.UTF_8;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugins.annotations.Mojo;
@@ -32,9 +33,10 @@ import javax.json.JsonReaderFactory;
 import javax.json.JsonStructure;
 import javax.json.JsonValue;
 import java.io.File;
+import java.io.FileOutputStream;
 import java.io.FileReader;
-import java.io.FileWriter;
 import java.io.IOException;
+import java.io.OutputStreamWriter;
 import java.io.StringWriter;
 import java.io.Writer;
 import java.util.Collection;
@@ -342,7 +344,7 @@ public class ExampleToModelMojo extends AbstractMojo {
 final File outputFile = new File(target, jsonToClass.replace('.', '/') 
+ ".java");
 
 outputFile.getParentFile().mkdirs();
-try (final FileWriter writer = new FileWriter(outputFile)) {
+try (final OutputStreamWriter writer = new OutputStreamWriter(new 
FileOutputStream(outputFile), UTF_8.name())) {
 generate(readerFactory, source, writer, javaName);
 } catch (IOException e) {
 throw new MojoExecutionException(e.getMessage(), e);
diff --git 
a/johnzon-maven-plugin/src/test/java/org/apache/johnzon/maven/plugin/ExampleToModelMojoTest.java
 
b/johnzon-maven-plugin/src/test/java/org/apache/johnzon/maven/plugin/ExampleToModelMojoTest.java
index 5a32199..b04bfd7 100644
--- 
a/johnzon-maven-plugin/src/test/java/org/apache/johnzon/maven/plugin/ExampleToModelMojoTest.java
+++ 
b/johnzon-maven-plugin/src/test/java/org/apache/johnzon/maven/plugin/ExampleToModelMojoTest.java
@@ -18,15 +18,18 @@
  */
 package org.apache.johnzon.maven.plugin;
 
+import static java.util.stream.Collectors.joining;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
-import org.codehaus.plexus.util.IOUtil;
 import org.junit.Test;
 
+import java.io.BufferedReader;
 import java.io.File;
-import java.io.FileReader;
+import java.io.FileInputStream;
 import java.io.FileWriter;
 import java.io.IOException;
+import java.io.InputStreamReader;
+import java.nio.charset.StandardCharsets;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
@@ -110,9 +113,21 @@ public class ExampleToModelMojoTest {
 
 final File output = new File(targetFolder, 
"org/test/apache/johnzon/mojo/SomeValue.java");
 assertTrue(output.isFile());
-assertEquals(
-new 
String(IOUtil.toByteArray(Thread.currentThread().getContextClassLoader().getResourceAsStream("SomeValue.java"))),
-new String(IOUtil.toByteArray(new 
FileReader(output))).replace(File.separatorChar, '/'));
+
+try (
+BufferedReader expectedBR = new BufferedReader(
+new InputStreamReader(
+
Thread.currentThread().getContextClassLoader().getResourceAsStream("SomeValue.java"),
+StandardCharsets.UTF_8));
+BufferedReader resultBR = new BufferedReader(
+new InputStreamReader(
+new FileInputStream(output), StandardCharsets.UTF_8))) {
+
+String expected = expectedBR.lines().collect(joining("\n")).trim();
+String result = resultBR.lines().collect(joining("\n")).trim();
+
+assertEquals(expected, result);
+}
 }
 
 @Test
@@ -195,8 +210,20 @@ public class ExampleToModelMojoTest {
 
 final File output = new File(targetFolder, 
"org/test/apache/johnzon/mojo/SomeValue.java");
 assertTrue(output.isFile());
-assertEquals(
-new 

[johnzon] branch master updated: JOHNZON-361 Johnzon maven plugin generates invalid record classes (#80)

2022-02-20 Thread rmannibucau
This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/johnzon.git


The following commit(s) were added to refs/heads/master by this push:
 new a4e708e  JOHNZON-361 Johnzon maven plugin generates invalid record 
classes (#80)
a4e708e is described below

commit a4e708e0c175977d850d79ce15c7d4999188911a
Author: Raymond Augé 
AuthorDate: Sun Feb 20 12:29:55 2022 -0500

JOHNZON-361 Johnzon maven plugin generates invalid record classes (#80)

Signed-off-by: Raymond Augé 
---
 .../johnzon/maven/plugin/ExampleToModelMojo.java  | 19 +++
 .../src/test/resources/SomeValue.record.java  |  2 +-
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git 
a/johnzon-maven-plugin/src/main/java/org/apache/johnzon/maven/plugin/ExampleToModelMojo.java
 
b/johnzon-maven-plugin/src/main/java/org/apache/johnzon/maven/plugin/ExampleToModelMojo.java
index 2ce7ee7..af34fbd 100644
--- 
a/johnzon-maven-plugin/src/main/java/org/apache/johnzon/maven/plugin/ExampleToModelMojo.java
+++ 
b/johnzon-maven-plugin/src/main/java/org/apache/johnzon/maven/plugin/ExampleToModelMojo.java
@@ -129,10 +129,10 @@ public class ExampleToModelMojo extends AbstractMojo {
 }
 
 if (useRecord) {
-writer.write("public record " + javaName + "(\n");
+writer.write("public record " + javaName + "(");
 writer.write(memBuffer.toString());
 } else {
-writer.write("public class " + javaName + " {\n");
+writer.write("public class " + javaName + " {");
 writer.write(memBuffer.toString());
 }
 writer.write("}\n");
@@ -146,6 +146,9 @@ public class ExampleToModelMojo extends AbstractMojo {
 final Map nestedTypes = new TreeMap<>();
 {
 final Iterator> iterator = 
object.entrySet().iterator();
+if (!object.isEmpty()) {
+writer.write("\n");
+}
 while (iterator.hasNext()) {
 final Map.Entry entry = iterator.next();
 final String key = entry.getKey();
@@ -190,6 +193,14 @@ public class ExampleToModelMojo extends AbstractMojo {
 }
 }
 
+if (object.isEmpty()) {
+if (useRecord) {
+writer.write(") {\n");
+} else {
+writer.write("\n");
+}
+}
+
 if (!object.isEmpty() && !nestedTypes.isEmpty()) {
 writer.write("\n");
 }
@@ -198,9 +209,9 @@ public class ExampleToModelMojo extends AbstractMojo {
 while (entries.hasNext()) {
 final Map.Entry entry = entries.next();
 if (useRecord) {
-writer.write(prefix + "public static record " + entry.getKey() 
+ "(\n");
+writer.write(prefix + "public static record " + entry.getKey() 
+ "(");
 } else {
-writer.write(prefix + "public static class " + entry.getKey() 
+ " {\n");
+writer.write(prefix + "public static class " + entry.getKey() 
+ " {");
 }
 generateFieldsAndMethods(writer, entry.getValue(), "" + 
prefix, imports);
 writer.write(prefix + "}\n");
diff --git a/johnzon-maven-plugin/src/test/resources/SomeValue.record.java 
b/johnzon-maven-plugin/src/test/resources/SomeValue.record.java
index 120d2bd..7d59a64 100644
--- a/johnzon-maven-plugin/src/test/resources/SomeValue.record.java
+++ b/johnzon-maven-plugin/src/test/resources/SomeValue.record.java
@@ -55,6 +55,6 @@ public record SomeValue(
 }
 }
 
-public static record SecondaryMetrics(
+public static record SecondaryMetrics() {
 }
 }


[johnzon] branch master updated: JOHNZON-360 Make buildable and testable on Java 17 (#79)

2022-02-20 Thread rmannibucau
This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/johnzon.git


The following commit(s) were added to refs/heads/master by this push:
 new dd94ec3  JOHNZON-360 Make buildable and testable on Java 17 (#79)
dd94ec3 is described below

commit dd94ec343b49d817e4e282f93b1a226ff2000260
Author: Raymond Augé 
AuthorDate: Sun Feb 20 12:29:20 2022 -0500

JOHNZON-360 Make buildable and testable on Java 17 (#79)

Signed-off-by: Raymond Augé 
---
 johnzon-jsonb/pom.xml  |  7 
 johnzon-jsonp-strict/pom.xml   |  7 
 johnzon-jsonschema/pom.xml | 17 ++
 .../src/test/resources/arquillian.xml  |  1 +
 pom.xml| 37 +-
 5 files changed, 54 insertions(+), 15 deletions(-)

diff --git a/johnzon-jsonb/pom.xml b/johnzon-jsonb/pom.xml
index 0ee3162..97b7a45 100644
--- a/johnzon-jsonb/pom.xml
+++ b/johnzon-jsonb/pom.xml
@@ -134,13 +134,6 @@
 
osgi.serviceloader;osgi.serviceloader=javax.json.bind.spi.JsonbProvider
   
 
-
-  
-biz.aQute.bnd
-biz.aQute.bndlib
-4.3.1
-  
-
   
 
   
diff --git a/johnzon-jsonp-strict/pom.xml b/johnzon-jsonp-strict/pom.xml
index aca67c3..6acd306 100644
--- a/johnzon-jsonp-strict/pom.xml
+++ b/johnzon-jsonp-strict/pom.xml
@@ -68,13 +68,6 @@
 
osgi.serviceloader;osgi.serviceloader=org.apache.johnzon.core.spi.JsonPointerFactory
   
 
-
-  
-biz.aQute.bnd
-biz.aQute.bndlib
-4.3.1
-  
-
   
 
   
diff --git a/johnzon-jsonschema/pom.xml b/johnzon-jsonschema/pom.xml
index 8ada11f..24f0f7f 100644
--- a/johnzon-jsonschema/pom.xml
+++ b/johnzon-jsonschema/pom.xml
@@ -61,4 +61,21 @@
   
 
   
+
+  
+
+jdk15+
+
+[15,)
+
+
+  
+org.openjdk.nashorn
+nashorn-core
+15.3
+test
+  
+
+
+  
 
diff --git a/johnzon-websocket/src/test/resources/arquillian.xml 
b/johnzon-websocket/src/test/resources/arquillian.xml
index 1f2d9d0..6312b91 100644
--- a/johnzon-websocket/src/test/resources/arquillian.xml
+++ b/johnzon-websocket/src/test/resources/arquillian.xml
@@ -32,6 +32,7 @@
   true
   target/apache-tomee-remote
   target/arquillian-test-working-dir
+  ${arquillian.jvm.args}
 
   
 
diff --git a/pom.xml b/pom.xml
index 4e77fa7..6d0cdbb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -42,14 +42,16 @@
 
https://svn.apache.org/repos/asf/johnzon/site/publish/
 scm:svn:${johnzon.site.url}
 ${project.build.directory}/site
-4.0.0
+5.1.4
 
[$(version;==;$(@)),$(version;+;$(@)))
+6.1.0
 1.8
 3.4.1
 2.15 
 
 -Xms1024m -Xmx2048m 
-Dfile.encoding=UTF-8
 2.0.23
+
   
 
   
@@ -447,6 +449,13 @@
 http://johnzon.apache.org/
   
 
+
+  
+biz.aQute.bnd
+biz.aQute.bndlib
+${bnd.version}
+  
+
   
 
   
@@ -786,5 +795,31 @@
 2.17
   
 
+
+
+jdk9+
+
+[9,)
+
+
+
+--add-opens=java.base/java.lang=ALL-UNNAMED
+
+
+
+
+
+jdk18+
+
+[18,)
+
+
+
+--add-opens=java.base/java.lang=ALL-UNNAMED
+-Xmx512m -Xms256m -XX:ReservedCodeCacheSize=64m 
-Dtomee.httpPort=38383
+-Djava.opts=
+
+
+