diff --git a/archetypes/quickstart/pom.xml b/archetypes/quickstart/pom.xml index 2de2937612a..552a19b4d3f 100644 --- a/archetypes/quickstart/pom.xml +++ b/archetypes/quickstart/pom.xml @@ -28,9 +28,31 @@ Wicket Quickstart Archetype + ${skipTests} + ${skipTests} true + false + + + + org.apache.wicket + wicket-core + test + + + org.apache.wicket + wicket-native-websocket-javax + test + + + org.apache.wicket + wicket-tester + test + + + @@ -48,6 +70,11 @@ + + + ${project.basedir}/src/test/resources + + org.apache.maven.archetype @@ -75,6 +102,20 @@ org.apache.maven.plugins maven-archetype-plugin + + org.apache.maven.plugins + maven-invoker-plugin + + + + install + + + test + + + + org.apache.maven.plugins maven-resources-plugin diff --git a/archetypes/quickstart/src/main/resources/archetype-resources/src/test/java/Start.java b/archetypes/quickstart/src/main/resources/archetype-resources/src/test/java/Start.java index f40a28a3bc7..d933d94c4f7 100644 --- a/archetypes/quickstart/src/main/resources/archetype-resources/src/test/java/Start.java +++ b/archetypes/quickstart/src/main/resources/archetype-resources/src/test/java/Start.java @@ -17,10 +17,14 @@ package ${package}; import java.lang.management.ManagementFactory; +import java.time.Duration; import javax.management.MBeanServer; import org.apache.wicket.protocol.ws.javax.WicketServerEndpointConfig; +import org.eclipse.jetty.ee11.servlet.ServletContextHandler; +import org.eclipse.jetty.ee11.webapp.WebAppContext; +import org.eclipse.jetty.ee11.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer; import org.eclipse.jetty.jmx.MBeanContainer; import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.HttpConnectionFactory; @@ -28,13 +32,9 @@ import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.SslConnectionFactory; -import org.eclipse.jetty.server.session.DefaultSessionCache; -import org.eclipse.jetty.server.session.FileSessionDataStore; -import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.util.resource.Resource; +import org.eclipse.jetty.util.resource.ResourceFactory; import org.eclipse.jetty.util.ssl.SslContextFactory; -import org.eclipse.jetty.webapp.WebAppContext; -import org.eclipse.jetty.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer; /** * Separate startup class for people that want to run the examples directly. Use parameter @@ -60,11 +60,11 @@ public static void main(String[] args) throws Exception ServerConnector http = new ServerConnector(server, new HttpConnectionFactory(http_config)); http.setPort(8080); - http.setIdleTimeout(1000 * 60 * 60); + http.setIdleTimeout(Duration.ofHours(1).toMillis()); server.addConnector(http); - Resource keystore = Resource.newClassPathResource("/keystore"); + Resource keystore = ResourceFactory.root().newClassLoaderResource("/keystore"); if (keystore != null && keystore.exists()) { // if a keystore for a SSL certificate is available, start a SSL @@ -101,19 +101,11 @@ public static void main(String[] args) throws Exception bb.setContextPath("/"); bb.setWar("src/main/webapp"); - // uncomment the next two lines if you want to start Jetty with WebSocket (JSR-356) support - // you need org.apache.wicket:wicket-native-websocket-javax in the classpath! - // ServerContainer serverContainer = WebSocketServerContainerInitializer.configureContext(bb); - // serverContainer.addEndpoint(new WicketServerEndpointConfig()); - -// bb.getSessionHandler().setSessionCache(sessionCache); - ServletContextHandler contextHandler = ServletContextHandler.getServletContextHandler(bb.getServletContext()); JakartaWebSocketServletContainerInitializer.configure(contextHandler, (servletContext, container) -> container.addEndpoint(new WicketServerEndpointConfig())); // uncomment next line if you want to test with JSESSIONID encoded in the urls - // ((AbstractSessionManager) - // bb.getSessionHandler().getSessionManager()).setUsingCookies(false); + // bb.getSessionHandler().setUsingCookies(false); server.setHandler(bb); diff --git a/archetypes/quickstart/src/test/resources/projects/sample-it-test/archetype.properties b/archetypes/quickstart/src/test/resources/projects/sample-it-test/archetype.properties new file mode 100644 index 00000000000..f761540be4e --- /dev/null +++ b/archetypes/quickstart/src/test/resources/projects/sample-it-test/archetype.properties @@ -0,0 +1,22 @@ +################################################################################ +## +## 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. +## +################################################################################ +groupId=org.apache.wicket.example +artifactId=my-test-app +version=1.0.0-SNAPSHOT +package=org.apache.wicket.example diff --git a/archetypes/quickstart/src/test/resources/projects/sample-it-test/goal.txt b/archetypes/quickstart/src/test/resources/projects/sample-it-test/goal.txt new file mode 100644 index 00000000000..31ed2f87a27 --- /dev/null +++ b/archetypes/quickstart/src/test/resources/projects/sample-it-test/goal.txt @@ -0,0 +1 @@ +clean verify diff --git a/pom.xml b/pom.xml index 06dcc866063..d3ba0a65177 100644 --- a/pom.xml +++ b/pom.xml @@ -215,6 +215,7 @@ 3.6.3 3.2.8 3.2.0 + 3.10.1 3.5.1 3.12.0 3.9.0 @@ -1086,6 +1087,11 @@ maven-install-plugin ${maven-install-plugin.version} + + org.apache.maven.plugins + maven-invoker-plugin + ${maven-invoker-plugin.version} + org.apache.maven.plugins maven-jar-plugin