This is an automated email from the ASF dual-hosted git repository. solomax pushed a commit to branch quickstart-fix1 in repository https://gitbox.apache.org/repos/asf/wicket.git
commit ff34dc089b690492a7178b9c1c576cb49f1f3bc0 Author: Maxim Solodovnik <[email protected]> AuthorDate: Tue Oct 13 10:28:20 2026 +0700 Fixes issue #1658: quickstart is tested during build --- archetypes/quickstart/pom.xml | 5 +++++ .../archetype-resources/src/test/java/Start.java | 17 ++++++++++------- .../projects/sample-it-test/archetype.properties | 22 ++++++++++++++++++++++ .../resources/projects/sample-it-test/goal.txt | 1 + 4 files changed, 38 insertions(+), 7 deletions(-) diff --git a/archetypes/quickstart/pom.xml b/archetypes/quickstart/pom.xml index 2de2937612..d8b12aa478 100644 --- a/archetypes/quickstart/pom.xml +++ b/archetypes/quickstart/pom.xml @@ -48,6 +48,11 @@ </includes> </resource> </resources> + <testResources> + <testResource> + <directory>${project.basedir}/src/test/resources</directory> + </testResource> + </testResources> <extensions> <extension> <groupId>org.apache.maven.archetype</groupId> 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 f40a28a3bc..ed97885b00 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,6 +17,7 @@ package ${package}; import java.lang.management.ManagementFactory; +import java.time.Duration; import javax.management.MBeanServer; @@ -28,13 +29,14 @@ import org.eclipse.jetty.server.SecureRequestCustomizer; 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.session.DefaultSessionCache; +import org.eclipse.jetty.session.FileSessionDataStore; 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; +import org.eclipse.jetty.ee11.servlet.ServletContextHandler; +import org.eclipse.jetty.ee11.webapp.WebAppContext; +import org.eclipse.jetty.ee11.websocket.jakarta.server.config.JakartaWebSocketServletContainerInitializer; /** * Separate startup class for people that want to run the examples directly. Use parameter @@ -42,6 +44,7 @@ import org.eclipse.jetty.websocket.jakarta.server.config.JakartaWebSocketServlet */ public class Start { + private static final int TIMEOUT = (int) Duration.ofHours(1).toMillis(); /** * Main function, starts the jetty server. * @@ -60,11 +63,11 @@ public class Start ServerConnector http = new ServerConnector(server, new HttpConnectionFactory(http_config)); http.setPort(8080); - http.setIdleTimeout(1000 * 60 * 60); + http.setIdleTimeout(TIMEOUT); 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 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 0000000000..f761540be4 --- /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 0000000000..31ed2f87a2 --- /dev/null +++ b/archetypes/quickstart/src/test/resources/projects/sample-it-test/goal.txt @@ -0,0 +1 @@ +clean verify
