Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading some dependencies #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
1 change: 0 additions & 1 deletion integration-tests/hello-world/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
15 changes: 7 additions & 8 deletions maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.2</version>
<version>3.5.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-invoker</artifactId>
<version>2.2</version>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
Expand Down Expand Up @@ -97,22 +97,21 @@
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.9.2</version>
<version>1.10.3</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.3.2</version>
<version>3.7</version>
</dependency>
<dependency>
<groupId>org.twdata.maven</groupId>
<artifactId>mojo-executor</artifactId>
<version>2.1.0</version>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.codemodel</groupId>
Expand All @@ -122,7 +121,7 @@
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>3.6.2.201501210735-r</version>
<version>4.11.0.201803080745-r</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand All @@ -137,7 +136,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.3</version>
<version>3.5.1</version>
<configuration>
<!-- see http://jira.codehaus.org/browse/MNG-5346 -->
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,9 @@ public static ServerContainer configureWebSocket(ServletContextHandler context)
// Create Filter
WebSocketUpgradeFilter filter = WebSocketUpgradeFilter.configureContext(context);

ServerContainer jettyContainer = new RedeployableServerContainer(
filter, filter.getConfiguration(), null);
// Create the Jetty ServerContainer implementation
ServerContainer jettyContainer = new RedeployableServerContainer(filter,filter.getFactory(),context.getServer().getThreadPool());
context.addBean(jettyContainer, true);

// Store a reference to the ServerContainer per javax.websocket spec 1.0 final section 6.4 Programmatic Server Deployment
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
package org.kantega.reststop.maven;

import org.eclipse.jetty.http.pathmap.MappedResource;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.websocket.jsr356.server.ServerContainer;
import org.eclipse.jetty.websocket.jsr356.server.ServerEndpointMetadata;
import org.eclipse.jetty.websocket.server.MappedWebSocketCreator;
import org.eclipse.jetty.websocket.server.WebSocketServerFactory;
import org.eclipse.jetty.websocket.servlet.WebSocketCreator;
import org.eclipse.jetty.websocket.server.NativeWebSocketConfiguration;

import javax.websocket.DeploymentException;
import javax.websocket.server.ServerEndpointConfig;
import java.util.Iterator;
import java.util.concurrent.Executor;

/**
*
*/
public class RedeployableServerContainer extends ServerContainer {
private final MappedWebSocketCreator creator;

public RedeployableServerContainer(MappedWebSocketCreator creator, WebSocketServerFactory factory, Executor executor) {
super(creator, factory, executor);
public RedeployableServerContainer(MappedWebSocketCreator creator,
NativeWebSocketConfiguration configuration,
HttpClient httpClient) {
super(configuration, httpClient);
this.creator = creator;
}

Expand All @@ -46,12 +45,10 @@ public void addEndpoint(ServerEndpointConfig config) throws DeploymentException
}

private void removeMapping(String path) {
Iterator<MappedResource<WebSocketCreator>> iterator = creator.getMappings().iterator();
while (iterator.hasNext()) {
MappedResource<WebSocketCreator> next = iterator.next();
if(next.getPathSpec().getDeclaration().equals(path)) {
iterator.remove();
}
}
// Due to how removeMapping and ServerEndpointMetadata.getPath() works we need to try these different
// mappings. See NativeWebSocketConfiguration.toPathSpec(path)
creator.removeMapping(path);
creator.removeMapping("uri-template|" + path);
creator.removeMapping("regex|" + path);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.3.9.v20160517</version>
<version>9.4.9.v20180320</version>
<configuration>

<systemProperties>
Expand Down
1 change: 0 additions & 1 deletion plugins/development/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>

</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion plugins/jaxrs-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0.1</version>
<version>2.1</version>
</dependency>
</dependencies>

Expand Down
6 changes: 6 additions & 0 deletions plugins/jersey/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,11 @@
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>${jersey.version}</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@

package org.kantega.reststop.jetty.websockets;

import org.eclipse.jetty.http.pathmap.MappedResource;
import org.eclipse.jetty.client.HttpClient;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.websocket.jsr356.server.ServerContainer;
import org.eclipse.jetty.websocket.jsr356.server.ServerEndpointMetadata;
import org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer;
import org.eclipse.jetty.websocket.server.MappedWebSocketCreator;
import org.eclipse.jetty.websocket.server.WebSocketServerFactory;
import org.eclipse.jetty.websocket.server.NativeWebSocketConfiguration;
import org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter;
import org.eclipse.jetty.websocket.servlet.WebSocketCreator;
import org.kantega.reststop.api.Config;
import org.kantega.reststop.api.Export;
import org.kantega.reststop.api.Plugin;
Expand All @@ -33,8 +32,6 @@
import javax.servlet.ServletException;
import javax.websocket.DeploymentException;
import javax.websocket.server.ServerEndpointConfig;
import java.util.Iterator;
import java.util.concurrent.Executor;

/**
*
Expand All @@ -56,7 +53,7 @@ public void customize(ServletContextHandler context) throws ServletException {
WebSocketUpgradeFilter filter = WebSocketUpgradeFilter.configureContext(context);

// Create the Jetty ServerContainer implementation
ServerContainer jettyContainer = new RedeployableServerContainer(filter, filter.getFactory(), context.getServer().getThreadPool());
ServerContainer jettyContainer = new RedeployableServerContainer(filter, filter.getConfiguration(), null);
context.addBean(jettyContainer, true);

// Store a reference to the ServerContainer per javax.websocket spec 1.0 final section 6.4 Programmatic Server Deployment
Expand All @@ -72,8 +69,10 @@ public void customize(ServletContextHandler context) throws ServletException {
private static class RedeployableServerContainer extends ServerContainer {
private final MappedWebSocketCreator creator;

public RedeployableServerContainer(MappedWebSocketCreator creator, WebSocketServerFactory factory, Executor executor) {
super(creator, factory, executor);
public RedeployableServerContainer(MappedWebSocketCreator creator,
NativeWebSocketConfiguration configuration,
HttpClient httpClient) {
super(configuration, httpClient);
this.creator = creator;
}

Expand All @@ -100,13 +99,11 @@ public void addEndpoint(ServerEndpointConfig config) throws DeploymentException
}

private void removeMapping(String path) {
Iterator<MappedResource<WebSocketCreator>> iterator = creator.getMappings().iterator();
while (iterator.hasNext()) {
MappedResource<WebSocketCreator> next = iterator.next();
if(next.getPathSpec().getDeclaration().equals(path)) {
iterator.remove();
}
}
// Due to how removeMapping and ServerEndpointMetadata.getPath() works we need to try these different
// mappings. See NativeWebSocketConfiguration.toPathSpec(path)
creator.removeMapping(path);
creator.removeMapping("uri-template|" + path);
creator.removeMapping("regex|" + path);
}
}
}
27 changes: 7 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,13 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jersey.version>2.25</jersey.version>
<jetty.version>9.3.9.v20160517</jetty.version><!-- Also defined in template-plugin-webapp-pom.xml -->
<jersey.version>2.26</jersey.version>
<jetty.version>9.4.9.v20180320</jetty.version><!-- Also defined in template-plugin-webapp-pom.xml -->
<maven.version>3.1.0</maven.version>
<maven-deploy-plugin.version>2.8.1</maven-deploy-plugin.version>
<aether.version>1.0.0.v20140518</aether.version>
<jexmec.version>2.0.0rc8</jexmec.version>
<logback.version>1.1.2</logback.version>
<slf4j.version>1.7.7</slf4j.version>
<aether.version>1.1.0</aether.version>
<logback.version>1.2.3</logback.version>
<slf4j.version>1.7.9</slf4j.version>
</properties>


Expand Down Expand Up @@ -166,25 +165,13 @@
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.2</version>
</dependency>

<dependency>
<groupId>org.kantega.jexmec</groupId>
<artifactId>jexmec-manager</artifactId>
<version>${jexmec.version}</version>
</dependency>

<dependency>
<groupId>org.kantega.jexmec</groupId>
<artifactId>jexmec-ctor-pl</artifactId>
<version>${jexmec.version}</version>
<version>1.3.2</version>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
<version>2.6</version>
</dependency>

<dependency>
Expand Down