update samples, remove obsolete profiles Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
diff --git a/demos/customprovider-jdk9/pom.xml b/demos/customprovider-jdk9/pom.xml index 8fdcee4..ef291a1 100644 --- a/demos/customprovider-jdk9/pom.xml +++ b/demos/customprovider-jdk9/pom.xml
@@ -65,10 +65,6 @@ --module-path ${project.build.directory}/classes:${mod.dir}:${project.build.directory}/test-classes --add-modules org.glassfish.jakarta.json.demos.customprovider </argLine> - <!-- - - -add-modules org.glassfish.jakarta.json.demos.customprovider,org.glassfish.jakarta.json,junit - - -patch-module org.glassfish.jakarta.json.demos.customprovider=${project.build.directory}/test-classes - --> </configuration> </plugin> </plugins> @@ -86,7 +82,6 @@ <dependency> <groupId>org.hamcrest</groupId> <artifactId>hamcrest-core</artifactId> - <version>1.3</version> <scope>test</scope> </dependency> </dependencies>
diff --git a/demos/customprovider-jdk9/src/main/jdk9/module-info.java b/demos/customprovider-jdk9/src/main/java/module-info.java similarity index 100% rename from demos/customprovider-jdk9/src/main/jdk9/module-info.java rename to demos/customprovider-jdk9/src/main/java/module-info.java
diff --git a/demos/facebook/pom.xml b/demos/facebook/pom.xml index 6ee6f53..d080aa7 100644 --- a/demos/facebook/pom.xml +++ b/demos/facebook/pom.xml
@@ -26,132 +26,76 @@ <properties> <main.class>org.glassfish.jsondemos.facebook.FacebookObjectSearch</main.class> + <!-- + <main.class>org.glassfish.jsondemos.facebook.FacebookStreamSearch</main.class> + --> + <modules.directory>${project.build.directory}/modules</modules.directory> </properties> - <profiles> - <profile> - <id>all</id> - <activation> - <activeByDefault>true</activeByDefault> - </activation> - <dependencies> - <dependency> - <groupId>jakarta.json</groupId> - <artifactId>jakarta.json-api</artifactId> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.glassfish</groupId> - <artifactId>jakarta.json</artifactId> - <scope>runtime</scope> - </dependency> - </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <executions> - <execution> - <id>example-facebook-jdk8</id> - <goals> - <goal>java</goal> - </goals> - </execution> - </executions> - <configuration> - <mainClass>${main.class}</mainClass> - </configuration> - </plugin> - </plugins> - </build> - </profile> + <dependencies> + <dependency> + <groupId>org.glassfish</groupId> + <artifactId>jakarta.json</artifactId> + </dependency> + </dependencies> - <profile> - <id>jdk9-setup</id> - <activation> - <jdk>[9,)</jdk> - </activation> - <dependencies> - <dependency> - <groupId>jakarta.json</groupId> - <artifactId>jakarta.json-api</artifactId> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.glassfish</groupId> - <artifactId>jakarta.json</artifactId> - <classifier>module</classifier> - <scope>compile</scope> - </dependency> - </dependencies> - <properties> - <modules.directory>${project.build.directory}/modules</modules.directory> - </properties> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <configuration> + <stripVersion>true</stripVersion> + <outputDirectory>${modules.directory}</outputDirectory> + </configuration> + <executions> + <execution> + <id>get-dependencies</id> + <phase>package</phase> + <goals> + <goal>copy-dependencies</goal> + </goals> + </execution> + <execution> + <id>get-project-artifact</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> <configuration> - <stripVersion>true</stripVersion> - <outputDirectory>${modules.directory}</outputDirectory> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> </configuration> - <executions> - <execution> - <id>get-dependencies</id> - <phase>package</phase> - <goals> - <goal>copy-dependencies</goal> - </goals> - <configuration> - <includeArtifactIds>jakarta.json</includeArtifactIds> - </configuration> - </execution> - <execution> - <id>get-project-artifact</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <configuration> - <executable>java</executable> - <arguments> - <argument>--add-modules</argument> - <argument>org.glassfish.jakarta.json</argument> - <argument>--module-path</argument> - <argument>${modules.directory}</argument> - <argument>-m</argument> - <argument>org.glassfish.jakarta.json.demos.facebook/${main.class}</argument> - </arguments> - </configuration> - <executions> - <execution> - <id>example-facebook-jdk9</id> - <goals> - <goal>exec</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - </profiles> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <configuration> + <executable>java</executable> + <arguments> + <argument>--module-path</argument> + <argument>${modules.directory}</argument> + <argument>-m</argument> + <argument>org.glassfish.jakarta.json.demos.facebook/${main.class}</argument> + </arguments> + </configuration> + <executions> + <execution> + <id>example-facebook</id> + <goals> + <goal>exec</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> </project>
diff --git a/demos/facebook/src/main/jdk9/module-info.java b/demos/facebook/src/main/java/module-info.java similarity index 90% rename from demos/facebook/src/main/jdk9/module-info.java rename to demos/facebook/src/main/java/module-info.java index aa91fb0..63f6774 100644 --- a/demos/facebook/src/main/jdk9/module-info.java +++ b/demos/facebook/src/main/java/module-info.java
@@ -9,5 +9,5 @@ */ module org.glassfish.jakarta.json.demos.facebook { - requires org.glassfish.jakarta.json; + requires jakarta.json; }
diff --git a/demos/jsonpointer/pom.xml b/demos/jsonpointer/pom.xml index 61bc2ff..cd02199 100644 --- a/demos/jsonpointer/pom.xml +++ b/demos/jsonpointer/pom.xml
@@ -26,131 +26,80 @@ <properties> <main.class>org.glassfish.jsondemos.jsonpointer.JsonpointerDemo</main.class> + <modules.directory>${project.build.directory}/modules</modules.directory> </properties> - <profiles> - <profile> - <id>all</id> - <activation> - <activeByDefault>true</activeByDefault> - </activation> - <dependencies> - <dependency> - <groupId>jakarta.json</groupId> - <artifactId>jakarta.json-api</artifactId> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.glassfish</groupId> - <artifactId>jakarta.json</artifactId> - <scope>runtime</scope> - </dependency> - </dependencies> - <build> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <executions> - <execution> - <id>example-jsonpointer-jdk8</id> - <goals> - <goal>java</goal> - </goals> - </execution> - </executions> - <configuration> - <mainClass>${main.class}</mainClass> - </configuration> - </plugin> - </plugins> - </build> - </profile> + <dependencies> + <dependency> + <groupId>jakarta.json</groupId> + <artifactId>jakarta.json-api</artifactId> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.glassfish</groupId> + <artifactId>jakarta.json</artifactId> + <classifier>module</classifier> + <scope>compile</scope> + </dependency> + </dependencies> - <profile> - <id>jdk9-setup</id> - <activation> - <jdk>[9,)</jdk> - </activation> - <dependencies> - <dependency> - <groupId>jakarta.json</groupId> - <artifactId>jakarta.json-api</artifactId> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.glassfish</groupId> - <artifactId>jakarta.json</artifactId> - <classifier>module</classifier> - <scope>compile</scope> - </dependency> - </dependencies> - <properties> - <modules.directory>${project.build.directory}/modules</modules.directory> - </properties> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <configuration> + <stripVersion>true</stripVersion> + <outputDirectory>${modules.directory}</outputDirectory> + </configuration> + <executions> + <execution> + <id>get-dependencies</id> + <phase>package</phase> + <goals> + <goal>copy-dependencies</goal> + </goals> + </execution> + <execution> + <id>get-project-artifact</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> <configuration> - <stripVersion>true</stripVersion> - <outputDirectory>${modules.directory}</outputDirectory> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> </configuration> - <executions> - <execution> - <id>get-dependencies</id> - <phase>package</phase> - <goals> - <goal>copy-dependencies</goal> - </goals> - <configuration> - <includeArtifactIds>jakarta.json</includeArtifactIds> - </configuration> - </execution> - <execution> - <id>get-project-artifact</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <configuration> - <executable>java</executable> - <arguments> - <argument>--add-modules</argument> - <argument>org.glassfish.jakarta.json</argument> - <argument>--module-path</argument> - <argument>${modules.directory}</argument> - <argument>-m</argument> - <argument>org.glassfish.jakarta.json.demos.jsonpointer/${main.class}</argument> - </arguments> - </configuration> - <executions> - <execution> - <id>example-jsonpointer-jdk9</id> - <goals> - <goal>exec</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - </profiles> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <configuration> + <executable>java</executable> + <arguments> + <argument>--module-path</argument> + <argument>${modules.directory}</argument> + <argument>-m</argument> + <argument>org.glassfish.jakarta.json.demos.jsonpointer/${main.class}</argument> + </arguments> + </configuration> + <executions> + <execution> + <id>example-jsonpointer</id> + <phase>verify</phase> + <goals> + <goal>exec</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> </project>
diff --git a/demos/jsonpointer/src/main/jdk9/module-info.java b/demos/jsonpointer/src/main/java/module-info.java similarity index 90% rename from demos/jsonpointer/src/main/jdk9/module-info.java rename to demos/jsonpointer/src/main/java/module-info.java index f7b2ac8..b14fa4a 100644 --- a/demos/jsonpointer/src/main/jdk9/module-info.java +++ b/demos/jsonpointer/src/main/java/module-info.java
@@ -9,5 +9,5 @@ */ module org.glassfish.jakarta.json.demos.jsonpointer { - requires org.glassfish.jakarta.json; + requires jakarta.json; }
diff --git a/demos/jsonpointer/src/main/java/org/glassfish/jsondemos/jsonpointer/JsonpointerDemo.java b/demos/jsonpointer/src/main/java/org/glassfish/jsondemos/jsonpointer/JsonpointerDemo.java index 241e237..4236a0f 100644 --- a/demos/jsonpointer/src/main/java/org/glassfish/jsondemos/jsonpointer/JsonpointerDemo.java +++ b/demos/jsonpointer/src/main/java/org/glassfish/jsondemos/jsonpointer/JsonpointerDemo.java
@@ -10,8 +10,15 @@ package org.glassfish.jsondemos.jsonpointer; -import jakarta.json.*; -import java.io.*; +import java.io.IOException; +import java.io.InputStream; + +import jakarta.json.Json; +import jakarta.json.JsonArray; +import jakarta.json.JsonObject; +import jakarta.json.JsonReader; +import jakarta.json.JsonString; +import jakarta.json.JsonValue; /** * JsonPointer (http://tools.ietf.org/html/rfc6901) demo with object model API @@ -23,6 +30,7 @@ public static void main(String... args) throws Exception { testWiki(); testPointer(); + System.out.println("Both tests PASSED !!!"); } private static void testWiki() throws IOException {
diff --git a/demos/pom.xml b/demos/pom.xml index a7b8c44..4b6c59f 100644 --- a/demos/pom.xml +++ b/demos/pom.xml
@@ -29,62 +29,13 @@ <legal.doc.source>${basedir}/..</legal.doc.source> </properties> - <profiles> - <profile> - <id>all</id> - <activation> - <activeByDefault>true</activeByDefault> - </activation> - <dependencies> - <dependency> - <groupId>jakarta.json</groupId> - <artifactId>jakarta.json-api</artifactId> - <scope>provided</scope> - </dependency> - </dependencies> - <modules> - <module>jaxrs</module> - <module>twitter</module> - <module>facebook</module> - <module>jsonpointer</module> - <module>servlet</module> - </modules> - </profile> - <profile> - <id>jdk9-all</id> - <activation> - <jdk>[9,)</jdk> - </activation> - <modules> - <module>jaxrs</module> - <module>twitter</module> - <module>facebook</module> - <module>jsonpointer</module> - <module>servlet</module> - <module>customprovider-jdk9</module> - </modules> - <build> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <executions> - <execution> - <id>add-jdk9-source</id> - <phase>generate-sources</phase> - <goals> - <goal>add-source</goal> - </goals> - <configuration> - <sources> - <source>src/main/jdk9</source> - </sources> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - </profiles> + <modules> + <module>jaxrs</module> + <module>twitter</module> + <module>facebook</module> + <module>jsonpointer</module> + <module>servlet</module> + <module>customprovider-jdk9</module> + </modules> + </project>
diff --git a/demos/twitter/pom.xml b/demos/twitter/pom.xml index 135958e..afee9bf 100644 --- a/demos/twitter/pom.xml +++ b/demos/twitter/pom.xml
@@ -26,140 +26,95 @@ <properties> <main.class>org.glassfish.jsondemos.twitter.TwitterObjectSearch</main.class> + <!-- + <main.class>org.glassfish.jsondemos.twitter.TwitterStreamSearch</main.class> + --> + <modules.directory>${project.build.directory}/modules</modules.directory> </properties> - <profiles> - <profile> - <id>all</id> - <activation> - <activeByDefault>true</activeByDefault> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <executions> - <execution> - <id>example-twitter-jdk8</id> - <goals> - <goal>java</goal> - </goals> - </execution> - </executions> - <configuration> - <mainClass>${main.class}</mainClass> - </configuration> - </plugin> - </plugins> - </build> - </profile> + <dependencies> + <dependency> + <groupId>jakarta.json</groupId> + <artifactId>jakarta.json-api</artifactId> + </dependency> + <dependency> + <groupId>org.glassfish</groupId> + <artifactId>jakarta.json</artifactId> + <classifier>module</classifier> + <scope>runtime</scope> + </dependency> - <profile> - <id>jdk9-setup</id> - <activation> - <jdk>[9,)</jdk> - </activation> - <dependencies> - <dependency> - <groupId>jakarta.json</groupId> - <artifactId>jakarta.json-api</artifactId> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>jakarta.xml.bind</groupId> - <artifactId>jakarta.xml.bind-api</artifactId> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>org.glassfish</groupId> - <artifactId>jakarta.json</artifactId> - <classifier>module</classifier> - <scope>compile</scope> - </dependency> - </dependencies> - <properties> - <modules.directory>${project.build.directory}/modules</modules.directory> - </properties> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <executions> - <execution> - <id>default-compile</id> - <configuration> - <compilerArgs> - <arg>--add-modules</arg> - <arg>java.xml.bind</arg> - </compilerArgs> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> + <dependency> + <groupId>jakarta.xml.bind</groupId> + <artifactId>jakarta.xml.bind-api</artifactId> + </dependency> + <dependency> + <groupId>com.sun.xml.bind</groupId> + <artifactId>jaxb-impl</artifactId> + <scope>runtime</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + <configuration> + <stripVersion>true</stripVersion> + <outputDirectory>${modules.directory}</outputDirectory> + </configuration> + <executions> + <execution> + <id>get-dependencies</id> + <phase>package</phase> + <goals> + <goal>copy-dependencies</goal> + </goals> <configuration> - <stripVersion>true</stripVersion> - <outputDirectory>${modules.directory}</outputDirectory> + <excludeArtifactIds>jakarta.activation-api</excludeArtifactIds> </configuration> - <executions> - <execution> - <id>get-dependencies</id> - <phase>package</phase> - <goals> - <goal>copy-dependencies</goal> - </goals> - <configuration> - <includeArtifactIds>jakarta.json</includeArtifactIds> - </configuration> - </execution> - <execution> - <id>get-project-artifact</id> - <phase>package</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - </artifactItem> - </artifactItems> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> + </execution> + <execution> + <id>get-project-artifact</id> + <phase>package</phase> + <goals> + <goal>copy</goal> + </goals> <configuration> - <executable>java</executable> - <arguments> - <argument>--add-modules</argument> - <argument>java.xml.bind,org.glassfish.jakarta.json</argument> - <argument>--module-path</argument> - <argument>${modules.directory}</argument> - <argument>-m</argument> - <argument>org.glassfish.jakarta.json.demos.twitter/${main.class}</argument> - </arguments> + <artifactItems> + <artifactItem> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </artifactItem> + </artifactItems> </configuration> - <executions> - <execution> - <id>example-twitter-jdk9</id> - <goals> - <goal>exec</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - </profiles> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <configuration> + <executable>java</executable> + <arguments> + <argument>--module-path</argument> + <argument>${modules.directory}</argument> + <argument>-m</argument> + <argument>org.glassfish.jakarta.json.demos.twitter/${main.class}</argument> + </arguments> + </configuration> + <executions> + <execution> + <id>example-twitter</id> + <goals> + <goal>exec</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> </project>
diff --git a/demos/twitter/src/main/jdk9/module-info.java b/demos/twitter/src/main/java/module-info.java similarity index 90% rename from demos/twitter/src/main/jdk9/module-info.java rename to demos/twitter/src/main/java/module-info.java index 3e99213..1996e3e 100644 --- a/demos/twitter/src/main/jdk9/module-info.java +++ b/demos/twitter/src/main/java/module-info.java
@@ -10,5 +10,5 @@ module org.glassfish.jakarta.json.demos.twitter { requires jakarta.xml.bind; - requires org.glassfish.jakarta.json; + requires jakarta.json; }
diff --git a/pom.xml b/pom.xml index 0eff9bf..5b0f967 100644 --- a/pom.xml +++ b/pom.xml
@@ -376,6 +376,12 @@ <artifactId>junit</artifactId> <version>4.12</version> </dependency> + <dependency> + <groupId>org.hamcrest</groupId> + <artifactId>hamcrest-core</artifactId> + <version>1.3</version> + <scope>test</scope> + </dependency> </dependencies> </dependencyManagement> @@ -389,18 +395,26 @@ <profile> <id>all</id> <dependencyManagement> + <!-- dependencies used by demo projects only --> <dependencies> <dependency> <groupId>jakarta.servlet</groupId> <artifactId>jakarta.servlet-api</artifactId> <version>5.0.0-M1</version> </dependency> + <dependency> + <groupId>com.sun.xml.bind</groupId> + <artifactId>jaxb-impl</artifactId> + <version>3.0.0-M4</version> + </dependency> </dependencies> </dependencyManagement> + <modules> <module>gf</module> <module>demos</module> </modules> + <build> <pluginManagement> <plugins>