Skip to content

Commit

Permalink
Drop RESTeasy support
Browse files Browse the repository at this point in the history
  • Loading branch information
dmandalidis committed Dec 21, 2024
1 parent 55bbebb commit c8c0a55
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 303 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
- 'v*'

env:
DOCKER_VERSION: 27.3.1
DOCKER_VERSION: 27.4.1

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
pull_request:

env:
DOCKER_VERSION: 27.3.1
DOCKER_VERSION: 27.4.1

jobs:
build:
Expand Down
55 changes: 1 addition & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,64 +31,11 @@ Download the latest JAR or grab [via Maven][maven-search]
</dependency>
```

Since multiple JAX-RS client implementations cannot coexist in a flat classpath,
you need to choose either one of Jersey or RESTeasy, or create your implementation
of `DockerClientBuilder` for something completely different.

### Jersey

For using Jersey, you will have to pull the following dependencies (versions are indicative):

```xml
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.connectors</groupId>
<artifactId>jersey-apache-connector</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>3.1.0</version>
</dependency>
```

### RESTeasy

For using RESTeasy, you will have to pull the following dependencies (versions are indicative):
```xml
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>6.1.0.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-core</artifactId>
<version>6.1.0.Final</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jakarta.rs</groupId>
<artifactId>jackson-jakarta-rs-json-provider</artifactId>
<version>2.13.1</version>
</dependency>
```

## Usage Example

```java
// Create a client based on DOCKER_HOST and DOCKER_CERT_PATH env vars
final DockerClient docker = new JerseyDockerClientBuilder().fromEnv().build(); // For Jersey
final DockerClient docker = new ResteasyDockerClientBuilder().fromEnv().build(); // For RESTeasy
final DockerClient docker = new JerseyDockerClientBuilder().fromEnv().build();

// Pull an image
docker.pull("busybox");
Expand Down
117 changes: 0 additions & 117 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,12 @@
<version.slf4j>2.0.16</version.slf4j>
<version.jackson>2.18.2</version.jackson>
<version.jersey>3.1.9</version.jersey>
<version.resteasy>6.1.0.Final</version.resteasy>
<version.immutables>2.10.1</version.immutables>
<version.apache.compress>1.27.1</version.apache.compress>
<version.unixsocket>0.38.23</version.unixsocket>
<version.apache.lang>2.6</version.apache.lang>
<version.bcpkix>1.79</version.bcpkix>
<version.google.oauth2>1.30.1</version.google.oauth2>
<version.jaxrs>3.1.0</version.jaxrs>

<version.junit>4.13.2</version.junit>
<version.mockito>5.14.2</version.mockito>
Expand Down Expand Up @@ -105,11 +103,6 @@
<artifactId>slf4j-api</artifactId>
<version>${version.slf4j}</version>
</dependency>
<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<version>${version.jaxrs}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
Expand Down Expand Up @@ -148,47 +141,29 @@
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>${version.jersey}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>${version.jersey}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.connectors</groupId>
<artifactId>jersey-apache5-connector</artifactId>
<version>${version.jersey}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>${version.jersey}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>${version.resteasy}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-core</artifactId>
<version>${version.resteasy}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jakarta.rs</groupId>
<artifactId>jackson-jakarta-rs-json-provider</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-base</artifactId>
<optional>true</optional>
</dependency>

<!--test deps -->
Expand Down Expand Up @@ -372,103 +347,11 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.plugin.surefire}</version>
<executions>
<execution>
<id>default-test</id>
<configuration>
<skip>true</skip>
</configuration>
</execution>
<execution>
<id>jersey-unit-tests</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<classpathDependencyExcludes>
<classpathDependencyExclude>org.jboss.resteasy:resteasy-client</classpathDependencyExclude>
<classpathDependencyExclude>org.jboss.resteasy:resteasy-core</classpathDependencyExclude>
<classpathDependencyExclude>com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-json-provider</classpathDependencyExclude>
<classpathDependencyExclude>com.fasterxml.jackson.jaxrs:jackson-jaxrs-base</classpathDependencyExclude>
</classpathDependencyExcludes>
<systemPropertyVariables>
<jaxrs.client>jersey</jaxrs.client>
</systemPropertyVariables>
<trimStackTrace>false</trimStackTrace>
</configuration>
</execution>
<execution>
<id>resteasy-unit-tests</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<classpathDependencyExcludes>
<classpathDependencyExclude>org.glassfish.jersey.core:jersey-client</classpathDependencyExclude>
<classpathDependencyExclude>org.glassfish.jersey.inject:jersey-hk2</classpathDependencyExclude>
<classpathDependencyExclude>org.glassfish.jersey.connectors:jersey-apache-connector</classpathDependencyExclude>
<classpathDependencyExclude>org.glassfish.jersey.media:jersey-media-json-jackson</classpathDependencyExclude>
</classpathDependencyExcludes>
<trimStackTrace>false</trimStackTrace>
<systemPropertyVariables>
<jaxrs.client>resteasy</jaxrs.client>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${version.plugin.failsafe}</version>
<executions>
<execution>
<id>default-test</id>
<configuration>
<skip>true</skip>
</configuration>
</execution>
<execution>
<id>jersey-integration-tests</id>
<phase>integration-test</phase>
<goals>
<goal>integration-test</goal>
</goals>
<configuration>
<classpathDependencyExcludes>
<classpathDependencyExclude>org.jboss.resteasy:resteasy-client</classpathDependencyExclude>
<classpathDependencyExclude>org.jboss.resteasy:resteasy-core</classpathDependencyExclude>
<classpathDependencyExclude>com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-json-provider</classpathDependencyExclude>
<classpathDependencyExclude>com.fasterxml.jackson.jaxrs:jackson-jaxrs-base</classpathDependencyExclude>
</classpathDependencyExcludes>
<systemPropertyVariables>
<jaxrs.client>jersey</jaxrs.client>
</systemPropertyVariables>
<trimStackTrace>false</trimStackTrace>
</configuration>
</execution>
<execution>
<id>resteasy-integration-tests</id>
<phase>integration-test</phase>
<goals>
<goal>integration-test</goal>
</goals>
<configuration>
<classpathDependencyExcludes>
<classpathDependencyExclude>org.glassfish.jersey.core:jersey-client</classpathDependencyExclude>
<classpathDependencyExclude>org.glassfish.jersey.inject:jersey-hk2</classpathDependencyExclude>
<classpathDependencyExclude>org.glassfish.jersey.connectors:jersey-apache-connector</classpathDependencyExclude>
<classpathDependencyExclude>org.glassfish.jersey.media:jersey-media-json-jackson</classpathDependencyExclude>
</classpathDependencyExcludes>
<systemPropertyVariables>
<jaxrs.client>resteasy</jaxrs.client>
</systemPropertyVariables>
<trimStackTrace>false</trimStackTrace>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@
*/
package org.mandas.docker.client.builder.jersey;

import jakarta.ws.rs.client.Client;
import jakarta.ws.rs.client.ClientBuilder;

import org.apache.http.client.config.RequestConfig;
import org.apache.http.config.Registry;
import org.apache.http.conn.HttpClientConnectionManager;
import org.apache.http.conn.socket.ConnectionSocketFactory;
import org.glassfish.jersey.apache.connector.ApacheClientProperties;
import org.glassfish.jersey.apache.connector.ApacheConnectorProvider;
import org.glassfish.jersey.apache5.connector.Apache5ClientProperties;
import org.glassfish.jersey.apache5.connector.Apache5ConnectorProvider;
import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.client.ClientProperties;
import org.glassfish.jersey.client.RequestEntityProcessing;
import org.glassfish.jersey.jackson.JacksonFeature;
import org.mandas.docker.client.builder.BaseDockerClientBuilder;
import org.mandas.docker.client.builder.ProxyConfiguration;

import jakarta.ws.rs.client.Client;
import jakarta.ws.rs.client.ClientBuilder;

public class JerseyDockerClientBuilder extends BaseDockerClientBuilder<JerseyDockerClientBuilder> {

private ClientConfig updateProxy(ClientConfig config) {
Expand Down Expand Up @@ -79,10 +79,10 @@ protected Client createClient() {
}

config
.connectorProvider(new ApacheConnectorProvider())
.property(ApacheClientProperties.CONNECTION_MANAGER, cm)
.property(ApacheClientProperties.CONNECTION_MANAGER_SHARED, "true")
.property(ApacheClientProperties.REQUEST_CONFIG, requestConfig);
.connectorProvider(new Apache5ConnectorProvider())
.property(Apache5ClientProperties.CONNECTION_MANAGER, cm)
.property(Apache5ClientProperties.CONNECTION_MANAGER_SHARED, "true")
.property(Apache5ClientProperties.REQUEST_CONFIG, requestConfig);

if (entityProcessing != null) {
switch (entityProcessing) {
Expand Down
Loading

0 comments on commit c8c0a55

Please sign in to comment.