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; - } }