From 221f30c0858ef7f343ef6f26273f255e5556d87d Mon Sep 17 00:00:00 2001 From: Maxim Nesen Date: Tue, 28 May 2024 16:27:47 +0200 Subject: [PATCH 1/2] archetypes refactoring Signed-off-by: Maxim Nesen --- .../resources/archetype-resources/pom.xml | 3 +- archetypes/jersey-heroku-webapp/pom.xml | 2 +- .../resources/archetype-resources/pom.xml | 5 +-- archetypes/jersey-quickstart-grizzly2/pom.xml | 2 +- .../src/main/resources/META-INF/archetype.xml | 29 ------------- .../META-INF/maven/archetype-metadata.xml | 42 +++++++++++++++++++ .../resources/archetype-resources/pom.xml | 5 +-- archetypes/jersey-quickstart-webapp/pom.xml | 2 +- .../src/main/resources/META-INF/archetype.xml | 29 ------------- .../META-INF/maven/archetype-metadata.xml | 42 +++++++++++++++++++ .../resources/archetype-resources/pom.xml | 3 +- examples/pom.xml | 2 +- .../jersey/test/artifacts/ArchetypesTest.java | 34 ++++----------- 13 files changed, 102 insertions(+), 98 deletions(-) delete mode 100644 archetypes/jersey-quickstart-grizzly2/src/main/resources/META-INF/archetype.xml create mode 100644 archetypes/jersey-quickstart-grizzly2/src/main/resources/META-INF/maven/archetype-metadata.xml delete mode 100644 archetypes/jersey-quickstart-webapp/src/main/resources/META-INF/archetype.xml create mode 100644 archetypes/jersey-quickstart-webapp/src/main/resources/META-INF/maven/archetype-metadata.xml diff --git a/archetypes/jersey-example-java8-webapp/src/main/resources/archetype-resources/pom.xml b/archetypes/jersey-example-java8-webapp/src/main/resources/archetype-resources/pom.xml index dc88fe13f3..af777dd4a0 100644 --- a/archetypes/jersey-example-java8-webapp/src/main/resources/archetype-resources/pom.xml +++ b/archetypes/jersey-example-java8-webapp/src/main/resources/archetype-resources/pom.xml @@ -1,7 +1,7 @@ - - - jersey-quickstart-grizzly2 - - src/main/java/Main.java - src/main/java/MyResource.java - - - src/test/java/MyResourceTest.java - - diff --git a/archetypes/jersey-quickstart-grizzly2/src/main/resources/META-INF/maven/archetype-metadata.xml b/archetypes/jersey-quickstart-grizzly2/src/main/resources/META-INF/maven/archetype-metadata.xml new file mode 100644 index 0000000000..54380e52c4 --- /dev/null +++ b/archetypes/jersey-quickstart-grizzly2/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,42 @@ + + + + + + + src/main/java + + **/* + + + + + src/test/java + + **/* + + + + \ No newline at end of file diff --git a/archetypes/jersey-quickstart-grizzly2/src/main/resources/archetype-resources/pom.xml b/archetypes/jersey-quickstart-grizzly2/src/main/resources/archetype-resources/pom.xml index 779f0802af..9d3236df3b 100644 --- a/archetypes/jersey-quickstart-grizzly2/src/main/resources/archetype-resources/pom.xml +++ b/archetypes/jersey-quickstart-grizzly2/src/main/resources/archetype-resources/pom.xml @@ -40,7 +40,7 @@ org.junit.jupiter junit-jupiter - \${junit-jupiter.version} + \${junit5.version} test @@ -83,8 +83,7 @@ ${project.version} - 5.10.2 + ${junit5.version} UTF-8 - 3.2.5 diff --git a/archetypes/jersey-quickstart-webapp/pom.xml b/archetypes/jersey-quickstart-webapp/pom.xml index 4fab928319..21aa6b3d72 100644 --- a/archetypes/jersey-quickstart-webapp/pom.xml +++ b/archetypes/jersey-quickstart-webapp/pom.xml @@ -36,7 +36,7 @@ org.apache.maven.plugins maven-resources-plugin - 2.5 + ${resources.mvn.plugin.version} \ diff --git a/archetypes/jersey-quickstart-webapp/src/main/resources/META-INF/archetype.xml b/archetypes/jersey-quickstart-webapp/src/main/resources/META-INF/archetype.xml deleted file mode 100644 index cea1eea5e9..0000000000 --- a/archetypes/jersey-quickstart-webapp/src/main/resources/META-INF/archetype.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - jersey-quickstart-webapp - - src/main/java/MyResource.java - - - src/main/webapp/index.jsp - src/main/webapp/WEB-INF/web.xml - - diff --git a/archetypes/jersey-quickstart-webapp/src/main/resources/META-INF/maven/archetype-metadata.xml b/archetypes/jersey-quickstart-webapp/src/main/resources/META-INF/maven/archetype-metadata.xml new file mode 100644 index 0000000000..bea65b3530 --- /dev/null +++ b/archetypes/jersey-quickstart-webapp/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -0,0 +1,42 @@ + + + + + + + src/main/java + + + src/main/webapp + + **/* + + + + src/test/java + + **/* + + + + \ No newline at end of file diff --git a/archetypes/jersey-quickstart-webapp/src/main/resources/archetype-resources/pom.xml b/archetypes/jersey-quickstart-webapp/src/main/resources/archetype-resources/pom.xml index fc70d51357..341fb67664 100644 --- a/archetypes/jersey-quickstart-webapp/src/main/resources/archetype-resources/pom.xml +++ b/archetypes/jersey-quickstart-webapp/src/main/resources/archetype-resources/pom.xml @@ -15,7 +15,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + ${compiler.mvn.plugin.version} true 1.8 @@ -63,6 +63,5 @@ ${project.version} UTF-8 - 3.4.0 diff --git a/examples/pom.xml b/examples/pom.xml index fd0009e590..b3d8cfcbd4 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -202,7 +202,7 @@ org.apache.maven.plugins maven-resources-plugin - 2.6 + ${resources.mvn.plugin.version} diff --git a/tests/release-test/src/test/java/org/glassfish/jersey/test/artifacts/ArchetypesTest.java b/tests/release-test/src/test/java/org/glassfish/jersey/test/artifacts/ArchetypesTest.java index b42830ba54..5be312c314 100644 --- a/tests/release-test/src/test/java/org/glassfish/jersey/test/artifacts/ArchetypesTest.java +++ b/tests/release-test/src/test/java/org/glassfish/jersey/test/artifacts/ArchetypesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2023, 2024 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0, which is available at @@ -52,16 +52,21 @@ public void testPropertiesVersion() throws XmlPullParserException, IOException { continue; } // Update the names with the ones in Jersey - Map.Entry updatedEntry = updateEntry(pomEntry); // Check the properties are there - if (properties.getProperty(updatedEntry.getKey().toString()) == null) { + final String key = pomEntry.getKey().toString(); + + if (properties.getProperty(key) == null) { testResult.ok().append("Property ") .append(pomEntry.getKey().toString()) .append(" from ").append(pom).println(" not in Jersey"); failed = true; } // check the values - else if (!properties.getProperty(updatedEntry.getKey().toString()).equals(updatedEntry.getValue())) { + else if ( + //archetype property value can be a variable from the main pom.xml - check and exclude if so + !(properties.containsKey(key) && pomEntry.getValue().toString().contains(key)) + && !properties.getProperty(key).equals(pomEntry.getValue()) + ) { testResult.exception().append("The property ") .append(pomEntry.getKey().toString()) .append(" in archetype pom ") @@ -81,25 +86,4 @@ else if (!properties.getProperty(updatedEntry.getKey().toString()).equals(update } } - private Map.Entry updateEntry(Map.Entry pomEntry) { - if (pomEntry.getKey().equals("junit-jupiter.version")) { - return new Map.Entry() { - @Override - public Object getKey() { - return "junit5.version"; - } - - @Override - public Object getValue() { - return pomEntry.getValue(); - } - - @Override - public Object setValue(Object value) { - return value; - } - }; - } - return pomEntry; - } } From c53840540ccc8a2579974bf4bdc8c57347c5e9de Mon Sep 17 00:00:00 2001 From: Maxim Nesen Date: Tue, 4 Jun 2024 13:58:56 +0200 Subject: [PATCH 2/2] mvn build improvements Signed-off-by: Maxim Nesen --- .../main/resources/archetype-resources/pom.xml | 4 ++-- bundles/apidocs/pom.xml | 2 +- bundles/jaxrs-ri/pom.xml | 2 +- connectors/helidon-connector/pom.xml | 2 +- core-common/pom.xml | 1 - core-server/pom.xml | 17 ++++++++++++++++- examples/extended-wadl-webapp/pom.xml | 2 +- examples/groovy/pom.xml | 6 +++--- examples/helloworld-spring-annotations/pom.xml | 4 ++-- examples/java8-webapp/pom.xml | 2 +- examples/jaxb/pom.xml | 2 +- .../osgi-http-service/functional-test/pom.xml | 2 +- examples/pom.xml | 2 +- ext/microprofile/mp-rest-client/pom.xml | 2 +- ext/spring4/pom.xml | 4 ++-- ext/spring5/pom.xml | 4 ++-- incubator/declarative-linking/pom.xml | 2 +- media/jaxb/pom.xml | 15 --------------- media/moxy/pom.xml | 15 --------------- pom.xml | 6 +++++- tests/e2e-tls/pom.xml | 2 +- tests/integration/JERSEY-2988/pom.xml | 2 +- .../cdi-resource-with-at-context/pom.xml | 2 +- tests/integration/jersey-2776/pom.xml | 2 +- .../runners/jersey-grizzly-runner/pom.xml | 2 +- tests/performance/test-cases/monitoring/pom.xml | 14 +++++++------- 26 files changed, 54 insertions(+), 66 deletions(-) diff --git a/archetypes/jersey-quickstart-grizzly2/src/main/resources/archetype-resources/pom.xml b/archetypes/jersey-quickstart-grizzly2/src/main/resources/archetype-resources/pom.xml index 9d3236df3b..087417f001 100644 --- a/archetypes/jersey-quickstart-grizzly2/src/main/resources/archetype-resources/pom.xml +++ b/archetypes/jersey-quickstart-grizzly2/src/main/resources/archetype-resources/pom.xml @@ -50,7 +50,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + ${compiler.mvn.plugin.version} true 1.8 @@ -60,7 +60,7 @@ org.codehaus.mojo exec-maven-plugin - 1.2.1 + ${exec.mvn.plugin.version} diff --git a/bundles/apidocs/pom.xml b/bundles/apidocs/pom.xml index 3f7f7c0f9a..a0ea49a315 100644 --- a/bundles/apidocs/pom.xml +++ b/bundles/apidocs/pom.xml @@ -127,7 +127,7 @@ org.glassfish javax.servlet - 3.1 + 3.1.1 org.glassfish.jersey.containers diff --git a/bundles/jaxrs-ri/pom.xml b/bundles/jaxrs-ri/pom.xml index aae987cf25..442cc53318 100644 --- a/bundles/jaxrs-ri/pom.xml +++ b/bundles/jaxrs-ri/pom.xml @@ -424,7 +424,7 @@ org.codehaus.mojo wagon-maven-plugin - 1.0-beta-4 + 2.0.2 false diff --git a/connectors/helidon-connector/pom.xml b/connectors/helidon-connector/pom.xml index 63bd4bbadc..a34b2583f4 100644 --- a/connectors/helidon-connector/pom.xml +++ b/connectors/helidon-connector/pom.xml @@ -34,7 +34,7 @@ io.helidon.jersey helidon-jersey-connector - 2.2.1 + ${helidon.connector.version} provided diff --git a/core-common/pom.xml b/core-common/pom.xml index 11d3977f5a..e93ca182d9 100644 --- a/core-common/pom.xml +++ b/core-common/pom.xml @@ -676,7 +676,6 @@ org.apache.maven.plugins maven-source-plugin - 3.0.1 attach-sources diff --git a/core-server/pom.xml b/core-server/pom.xml index 1fc66f1bde..5b32a1e99a 100644 --- a/core-server/pom.xml +++ b/core-server/pom.xml @@ -227,7 +227,13 @@ org.jboss jboss-vfs - 3.2.6.Final + ${jboss.vfs.version} + test + + + org.jboss.logging + jboss-logging + ${jboss.logging.version} test @@ -240,6 +246,15 @@ + + jdk8 + + 1.8 + + + ${jboss.vfs.jdk8.version} + + jdk11+ diff --git a/examples/extended-wadl-webapp/pom.xml b/examples/extended-wadl-webapp/pom.xml index 051ade4546..0d1a933fd3 100644 --- a/examples/extended-wadl-webapp/pom.xml +++ b/examples/extended-wadl-webapp/pom.xml @@ -109,7 +109,7 @@ org.slf4j slf4j-log4j12 - 1.6.4 + 2.0.13 test diff --git a/examples/groovy/pom.xml b/examples/groovy/pom.xml index 201f35ac27..b527e8749c 100644 --- a/examples/groovy/pom.xml +++ b/examples/groovy/pom.xml @@ -48,7 +48,7 @@ org.junit.jupiter junit-jupiter-engine - 5.8.2 + ${junit5.version} test @@ -83,7 +83,7 @@ org.codehaus.gmavenplus gmavenplus-plugin - 1.12.1 + 3.0.0 1 @@ -126,7 +126,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.0.0 + ${buildhelper.mvn.plugin.version} 3 diff --git a/examples/helloworld-spring-annotations/pom.xml b/examples/helloworld-spring-annotations/pom.xml index ea11e81741..1723ca6665 100644 --- a/examples/helloworld-spring-annotations/pom.xml +++ b/examples/helloworld-spring-annotations/pom.xml @@ -44,7 +44,7 @@ commons-logging commons-logging - 1.2 + ${commons.logging.version} org.glassfish.jersey.test-framework.providers @@ -54,7 +54,7 @@ javax.servlet javax.servlet-api - 3.0.1 + ${servlet3.version} diff --git a/examples/java8-webapp/pom.xml b/examples/java8-webapp/pom.xml index da28b44284..87098e8755 100644 --- a/examples/java8-webapp/pom.xml +++ b/examples/java8-webapp/pom.xml @@ -56,7 +56,7 @@ org.eclipse.jetty jetty-maven-plugin - 9.2.6.v20141205 + ${jetty.version} 5 9999 diff --git a/examples/jaxb/pom.xml b/examples/jaxb/pom.xml index 275855d4bd..5a2b873d4b 100644 --- a/examples/jaxb/pom.xml +++ b/examples/jaxb/pom.xml @@ -37,7 +37,7 @@ org.codehaus.woodstox woodstox-core-asl - 4.1.2 + 4.4.1 org.glassfish.jersey.media diff --git a/examples/osgi-http-service/functional-test/pom.xml b/examples/osgi-http-service/functional-test/pom.xml index a1425e5db6..4bb826e3e2 100644 --- a/examples/osgi-http-service/functional-test/pom.xml +++ b/examples/osgi-http-service/functional-test/pom.xml @@ -145,7 +145,7 @@ org.slf4j slf4j-log4j12 - 1.6.4 + 2.0.13 test diff --git a/examples/pom.xml b/examples/pom.xml index b3d8cfcbd4..596fde5347 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -185,7 +185,7 @@ org.commonjava.maven.plugins directory-maven-plugin - 0.3.1 + 1.0 directories diff --git a/ext/microprofile/mp-rest-client/pom.xml b/ext/microprofile/mp-rest-client/pom.xml index 34a1405245..560e58f3b0 100644 --- a/ext/microprofile/mp-rest-client/pom.xml +++ b/ext/microprofile/mp-rest-client/pom.xml @@ -77,7 +77,7 @@ javax.enterprise cdi-api - 2.0 + ${cdi.api.version} provided diff --git a/ext/spring4/pom.xml b/ext/spring4/pom.xml index 611b90547d..d003c719f2 100644 --- a/ext/spring4/pom.xml +++ b/ext/spring4/pom.xml @@ -65,7 +65,7 @@ commons-logging commons-logging - 1.2 + ${commons.logging.version} test @@ -150,7 +150,7 @@ org.aspectj aspectjrt - 1.6.11 + 1.9.22.1 test diff --git a/ext/spring5/pom.xml b/ext/spring5/pom.xml index 64946def34..709d11f4fb 100644 --- a/ext/spring5/pom.xml +++ b/ext/spring5/pom.xml @@ -65,7 +65,7 @@ commons-logging commons-logging - 1.2 + ${commons.logging.version} test @@ -154,7 +154,7 @@ org.aspectj aspectjrt - 1.6.11 + 1.9.22.1 test diff --git a/incubator/declarative-linking/pom.xml b/incubator/declarative-linking/pom.xml index 024e71d00f..1b6d5b029f 100644 --- a/incubator/declarative-linking/pom.xml +++ b/incubator/declarative-linking/pom.xml @@ -83,7 +83,7 @@ org.skyscreamer jsonassert - 1.4.0 + 1.5.1 test diff --git a/media/jaxb/pom.xml b/media/jaxb/pom.xml index cb41dbcf15..38d987301a 100644 --- a/media/jaxb/pom.xml +++ b/media/jaxb/pom.xml @@ -82,21 +82,6 @@ build-helper-maven-plugin true - - de.jflex - maven-jflex-plugin - 1.4.3 - - - - generate - - - ${project.build.directory}/generated-sources/rsrc-gen - - - - org.apache.felix maven-bundle-plugin diff --git a/media/moxy/pom.xml b/media/moxy/pom.xml index 96042128d5..8744ebc0eb 100644 --- a/media/moxy/pom.xml +++ b/media/moxy/pom.xml @@ -62,21 +62,6 @@ - - de.jflex - maven-jflex-plugin - 1.4.3 - - - - generate - - - ${project.build.directory}/generated-sources/rsrc-gen - - - - diff --git a/pom.xml b/pom.xml index c2a22c2a70..0b83d1cf6d 100644 --- a/pom.xml +++ b/pom.xml @@ -2214,6 +2214,7 @@ 33.1.0-jre 2.2 1.4.14 + 2.2.1 2.10.0 4.5.14 5.3.1 @@ -2223,6 +2224,9 @@ 1.19.3 ${jersey1.version} 1.3.7 + 3.3.2.Final + 3.2.17.Final + 3.6.0.Final 1.37 1.49 4.13.2 @@ -2258,7 +2262,7 @@ 20.3.14 - 1.2 + 2.0.SP1 2.0.2 javax.enterprise.*;version="[1,3)" 3.2.6 diff --git a/tests/e2e-tls/pom.xml b/tests/e2e-tls/pom.xml index dfecf09378..b7657c5f59 100644 --- a/tests/e2e-tls/pom.xml +++ b/tests/e2e-tls/pom.xml @@ -96,7 +96,7 @@ io.specto hoverfly-java-junit5 - 0.14.0 + 0.18.1 test diff --git a/tests/integration/JERSEY-2988/pom.xml b/tests/integration/JERSEY-2988/pom.xml index e47be8324e..dc74f72b1d 100644 --- a/tests/integration/JERSEY-2988/pom.xml +++ b/tests/integration/JERSEY-2988/pom.xml @@ -61,7 +61,7 @@ javax.enterprise cdi-api - 2.0 + ${cdi.api.version} org.jboss.weld.servlet diff --git a/tests/integration/cdi-integration/cdi-resource-with-at-context/pom.xml b/tests/integration/cdi-integration/cdi-resource-with-at-context/pom.xml index 6f0ef1bee0..21cce901ec 100644 --- a/tests/integration/cdi-integration/cdi-resource-with-at-context/pom.xml +++ b/tests/integration/cdi-integration/cdi-resource-with-at-context/pom.xml @@ -46,7 +46,7 @@ javax.enterprise cdi-api - 2.0 + ${cdi.api.version} provided diff --git a/tests/integration/jersey-2776/pom.xml b/tests/integration/jersey-2776/pom.xml index 51234decb8..be57cca805 100644 --- a/tests/integration/jersey-2776/pom.xml +++ b/tests/integration/jersey-2776/pom.xml @@ -42,7 +42,7 @@ org.apache.cxf cxf-rt-rs-client - 3.0.3 + 3.5.8 test diff --git a/tests/performance/runners/jersey-grizzly-runner/pom.xml b/tests/performance/runners/jersey-grizzly-runner/pom.xml index 10ce415226..c5c265a36a 100644 --- a/tests/performance/runners/jersey-grizzly-runner/pom.xml +++ b/tests/performance/runners/jersey-grizzly-runner/pom.xml @@ -49,7 +49,7 @@ org.apache.maven.plugins maven-jar-plugin - 2.4 + ${jar.mvn.plugin.version} true diff --git a/tests/performance/test-cases/monitoring/pom.xml b/tests/performance/test-cases/monitoring/pom.xml index c4076c2a7d..d5b84bd93c 100644 --- a/tests/performance/test-cases/monitoring/pom.xml +++ b/tests/performance/test-cases/monitoring/pom.xml @@ -37,13 +37,13 @@ com.yammer.metrics metrics-core - 2.1.2 + 2.2.0 org.junit.jupiter junit-jupiter - 5.9.1 + 5.10.2 test @@ -56,13 +56,13 @@ commons-codec commons-codec - 1.5 + 1.17.0 org.slf4j slf4j-jdk14 - 1.6.1 + 2.0.13 @@ -97,11 +97,11 @@ org.apache.maven.plugins maven-compiler-plugin - 3.1 + 3.13.0 true - 1.7 - 1.7 + 1.8 + 1.8 false false