This is an automated email from the ASF dual-hosted git repository.

solomax pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/wicket.git


The following commit(s) were added to refs/heads/master by this push:
     new 5cbd566125 Fixes issue #1658: quickstart is tested during build (#1663)
5cbd566125 is described below

commit 5cbd5661255b3e5498e40d093fa58e83085832ce
Author: Maxim Solodovnik <[email protected]>
AuthorDate: Wed Oct 14 20:42:54 2026 +0700

    Fixes issue #1658: quickstart is tested during build (#1663)
    
    * Fixes issue #1658: quickstart is tested during build
    
    * Build the quickstart integration test against the reactor's Wicket
    
    The archetype integration test ran clean verify on the generated project
    with whatever Wicket artifacts the local repository or the Apache
    snapshot repository held. CI runs verify without install, and the
    archetype module did not depend on the modules the generated project
    uses, so the reactor could even build it before them. A change to
    wicket-core or wicket-native-websocket-javax was tested against the
    previous nightly snapshot, and right after a version bump the generated
    project could not resolve Wicket at all until a snapshot of the new
    version was published.
    
    The archetype module now declares the generated project's Wicket
    modules as test dependencies, which orders it after them in the reactor,
    and maven-invoker-plugin:install copies them, their reactor dependencies
    and their parent poms into the local repository before the integration
    test runs. A plain mvn verify therefore writes these snapshots to the
    local repository, as mvn install would have. The installation and the
    integration test both follow -DskipTests, so a build that skips tests no
    longer generates and builds a project; -Darchetype.test.skip still skips
    the integration test alone.
    
    Start.java loses what was left over from Jetty 11: the unused session
    store imports, the commented-out session cache line and the obsolete
    JSR-356 instructions. The JSESSIONID hint uses the Jetty 12 session
    handler API, and the HTTP idle timeout is the literal it was before.
    
    GitHub issue #1658
    
    Generated-by: Claude Code (Claude Opus 5.5)
    
    * Express the quickstart's HTTP idle timeout as a Duration
    
    The previous commit turned the idle timeout back into 1000 * 60 * 60,
    undoing the Duration the original port introduced. Duration.ofHours(1)
    states the intent more plainly; toMillis() is passed as is, because
    setIdleTimeout takes a long and needs no cast to int. The timeout stays
    one hour, and the HTTPS connector keeps its own value.
    
    GitHub issue #1658
    
    Generated-by: Claude Code (Claude Opus 5.5)
    
    ---------
    
    Co-authored-by: Martijn Dashorst <[email protected]>
---
 archetypes/quickstart/pom.xml                      | 41 ++++++++++++++++++++++
 .../archetype-resources/src/test/java/Start.java   | 24 +++++--------
 .../projects/sample-it-test/archetype.properties   | 22 ++++++++++++
 .../resources/projects/sample-it-test/goal.txt     |  1 +
 pom.xml                                            |  6 ++++
 5 files changed, 78 insertions(+), 16 deletions(-)

diff --git a/archetypes/quickstart/pom.xml b/archetypes/quickstart/pom.xml
index 2de2937612..552a19b4d3 100644
--- a/archetypes/quickstart/pom.xml
+++ b/archetypes/quickstart/pom.xml
@@ -28,9 +28,31 @@
        <name>Wicket Quickstart Archetype</name>
 
        <properties>
+               <archetype.test.skip>${skipTests}</archetype.test.skip>
+               <invoker.skip>${skipTests}</invoker.skip>
                <japicmp.skip>true</japicmp.skip>
+               <skipTests>false</skipTests>
        </properties>
 
+       <!-- the Wicket modules of the generated project, installed for the 
archetype integration test -->
+       <dependencies>
+               <dependency>
+                       <groupId>org.apache.wicket</groupId>
+                       <artifactId>wicket-core</artifactId>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.wicket</groupId>
+                       <artifactId>wicket-native-websocket-javax</artifactId>
+                       <scope>test</scope>
+               </dependency>
+               <dependency>
+                       <groupId>org.apache.wicket</groupId>
+                       <artifactId>wicket-tester</artifactId>
+                       <scope>test</scope>
+               </dependency>
+       </dependencies>
+
        <build>
                <resources>
                        <resource>
@@ -48,6 +70,11 @@
                                </includes>
                        </resource>
                </resources>
+               <testResources>
+                       <testResource>
+                               
<directory>${project.basedir}/src/test/resources</directory>
+                       </testResource>
+               </testResources>
                <extensions>
                        <extension>
                                <groupId>org.apache.maven.archetype</groupId>
@@ -75,6 +102,20 @@
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-archetype-plugin</artifactId>
                        </plugin>
+                       <plugin>
+                               <groupId>org.apache.maven.plugins</groupId>
+                               <artifactId>maven-invoker-plugin</artifactId>
+                               <executions>
+                                       <execution>
+                                               <goals>
+                                                       <goal>install</goal>
+                                               </goals>
+                                               <configuration>
+                                                       <scope>test</scope>
+                                               </configuration>
+                                       </execution>
+                               </executions>
+                       </plugin>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-resources-plugin</artifactId>
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..d933d94c4f 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.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.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 class Start
 
                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 class Start
                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 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
diff --git a/pom.xml b/pom.xml
index 06dcc86606..d3ba0a6517 100644
--- a/pom.xml
+++ b/pom.xml
@@ -215,6 +215,7 @@
                
<maven-enforcer-plugin.version>3.6.3</maven-enforcer-plugin.version>
                <maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
                
<maven-install-plugin.version>3.2.0</maven-install-plugin.version>
+               
<maven-invoker-plugin.version>3.10.1</maven-invoker-plugin.version>
                <maven-jar-plugin.version>3.5.1</maven-jar-plugin.version>
                
<maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
                
<maven-project-info-reports-plugin.version>3.9.0</maven-project-info-reports-plugin.version>
@@ -1086,6 +1087,11 @@
                                        
<artifactId>maven-install-plugin</artifactId>
                                        
<version>${maven-install-plugin.version}</version>
                                </plugin>
+                               <plugin>
+                                       
<groupId>org.apache.maven.plugins</groupId>
+                                       
<artifactId>maven-invoker-plugin</artifactId>
+                                       
<version>${maven-invoker-plugin.version}</version>
+                               </plugin>
                                <plugin>
                                        
<groupId>org.apache.maven.plugins</groupId>
                                        
<artifactId>maven-jar-plugin</artifactId>

Reply via email to