Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions archetypes/quickstart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@
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;
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
Expand All @@ -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
Expand Down Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
clean verify
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
Loading