Skip to content

Commit fba9639

Browse files
committed
Update deps. Fix IT.
- remove custom jersey connector - update all deps - httpclient latest fails, stay on working version
1 parent e5a1cd8 commit fba9639

File tree

10 files changed

+101
-901
lines changed

10 files changed

+101
-901
lines changed

pom.xml

Lines changed: 49 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -47,35 +47,35 @@
4747
<jdk.source>1.7</jdk.source>
4848
<jdk.target>1.7</jdk.target>
4949

50-
<jersey.version>2.11</jersey.version>
50+
<jersey.version>2.23.1</jersey.version>
5151
<jackson-jaxrs.version>2.6.4</jackson-jaxrs.version>
52-
<httpclient.version>4.3.1</httpclient.version>
53-
<commons-compress.version>1.5</commons-compress.version>
54-
<commons-codec.version>1.8</commons-codec.version>
55-
<commons-io.version>2.3</commons-io.version>
52+
<httpclient.version>4.5</httpclient.version><!-- 4.5.1-4.5.2 broken -->
53+
<commons-compress.version>1.12</commons-compress.version>
54+
<commons-codec.version>1.10</commons-codec.version>
55+
<commons-io.version>2.5</commons-io.version>
5656
<commons-lang.version>2.6</commons-lang.version>
57-
<slf4j-api.version>1.7.5</slf4j-api.version>
57+
<slf4j-api.version>1.7.21</slf4j-api.version>
5858

59-
<bouncycastle.version>1.51</bouncycastle.version>
60-
<unix-socket-factory.version>2015-01-27T15-02-14</unix-socket-factory.version>
61-
<guava.version>18.0</guava.version>
59+
<bouncycastle.version>1.54</bouncycastle.version>
60+
<unix-socket-factory.version>2016-04-06T22-21-19</unix-socket-factory.version>
61+
<guava.version>19.0</guava.version>
6262

6363
<!-- test dependencies -->
64-
<logback.version>1.1.0</logback.version>
65-
<testng.version>6.1.1</testng.version>
66-
<netty.version>4.1.0.CR3</netty.version>
64+
<logback.version>1.1.7</logback.version>
65+
<testng.version>6.9.10</testng.version>
66+
<netty.version>4.1.1.Final</netty.version>
6767
<hamcrest.library.version>1.3</hamcrest.library.version>
68-
<hamcrest.jpa-matchers>1.6</hamcrest.jpa-matchers>
68+
<hamcrest.jpa-matchers>1.8</hamcrest.jpa-matchers>
6969
<lambdaj.version>2.3.3</lambdaj.version>
7070
<mockito.version>1.10.19</mockito.version>
7171

7272

73-
<maven-jar-plugin.version>2.2</maven-jar-plugin.version>
74-
<maven-compiler-plugin.version>2.3.1</maven-compiler-plugin.version>
75-
<maven-release-plugin.version>2.3.1</maven-release-plugin.version>
73+
<maven-jar-plugin.version>3.0.2</maven-jar-plugin.version>
74+
<maven-compiler-plugin.version>3.5.1</maven-compiler-plugin.version>
75+
<maven-release-plugin.version>2.5.3</maven-release-plugin.version>
7676
<maven-surefire-plugin.version>2.19.1</maven-surefire-plugin.version>
7777
<maven-failsafe-plugin.version>2.19.1</maven-failsafe-plugin.version>
78-
<maven-antrun-plugin.version>1.7</maven-antrun-plugin.version>
78+
<maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
7979
</properties>
8080

8181
<dependencies>
@@ -89,6 +89,11 @@
8989
<artifactId>jersey-apache-connector</artifactId>
9090
<version>${jersey.version}</version>
9191
</dependency>
92+
<dependency>
93+
<groupId>org.apache.httpcomponents</groupId>
94+
<artifactId>httpcore</artifactId>
95+
<version>4.4.5</version>
96+
</dependency>
9297
<dependency>
9398
<groupId>org.apache.httpcomponents</groupId>
9499
<artifactId>httpclient</artifactId>
@@ -99,10 +104,20 @@
99104
<artifactId>jersey-client</artifactId>
100105
<version>${jersey.version}</version>
101106
</dependency>
107+
<!--<dependency>-->
108+
<!--<groupId>de.gesellix</groupId>-->
109+
<!--<artifactId>unix-socket-factory</artifactId>-->
110+
<!--<version>${unix-socket-factory.version}</version>-->
111+
<!--</dependency>-->
112+
<dependency>
113+
<groupId>com.kohlschutter.junixsocket</groupId>
114+
<artifactId>junixsocket-common</artifactId>
115+
<version>2.0.4</version>
116+
</dependency>
102117
<dependency>
103-
<groupId>de.gesellix</groupId>
104-
<artifactId>unix-socket-factory</artifactId>
105-
<version>${unix-socket-factory.version}</version>
118+
<groupId>com.kohlschutter.junixsocket</groupId>
119+
<artifactId>junixsocket-native-common</artifactId>
120+
<version>2.0.4</version>
106121
</dependency>
107122

108123
<dependency>
@@ -133,7 +148,7 @@
133148
<dependency>
134149
<groupId>org.slf4j</groupId>
135150
<artifactId>jcl-over-slf4j</artifactId>
136-
<version>1.7.12</version>
151+
<version>1.7.21</version>
137152
</dependency>
138153

139154
<dependency>
@@ -206,7 +221,7 @@
206221
<dependency>
207222
<groupId>com.google.code.findbugs</groupId>
208223
<artifactId>annotations</artifactId>
209-
<version>3.0.0</version>
224+
<version>3.0.1</version>
210225
<scope>provided</scope>
211226
</dependency>
212227

@@ -231,6 +246,12 @@
231246
<version>${netty.version}</version>
232247
<classifier>linux-x86_64</classifier>
233248
</dependency>
249+
<dependency>
250+
<groupId>junit</groupId>
251+
<artifactId>junit</artifactId>
252+
<version>4.12</version>
253+
<scope>test</scope>
254+
</dependency>
234255
</dependencies>
235256

236257
<distributionManagement>
@@ -321,7 +342,7 @@
321342
<plugin>
322343
<groupId>org.apache.maven.plugins</groupId>
323344
<artifactId>maven-source-plugin</artifactId>
324-
<version>2.2.1</version>
345+
<version>3.0.1</version>
325346
<executions>
326347
<execution>
327348
<id>attach-sources</id>
@@ -334,7 +355,7 @@
334355
<plugin>
335356
<groupId>org.apache.maven.plugins</groupId>
336357
<artifactId>maven-javadoc-plugin</artifactId>
337-
<version>2.9.1</version>
358+
<version>2.10.4</version>
338359
<executions>
339360
<execution>
340361
<id>attach-javadocs</id>
@@ -350,7 +371,7 @@
350371
<plugin>
351372
<groupId>org.sonatype.plugins</groupId>
352373
<artifactId>nexus-staging-maven-plugin</artifactId>
353-
<version>1.6.2</version>
374+
<version>1.6.7</version>
354375
<extensions>true</extensions>
355376
<configuration>
356377
<serverId>ossrh</serverId>
@@ -362,7 +383,7 @@
362383
<plugin>
363384
<groupId>org.apache.maven.plugins</groupId>
364385
<artifactId>maven-release-plugin</artifactId>
365-
<version>2.5</version>
386+
<version>${maven-release-plugin.version}</version>
366387
<configuration>
367388
<autoVersionSubmodules>true</autoVersionSubmodules>
368389
<useReleaseProfile>false</useReleaseProfile>
@@ -465,7 +486,7 @@
465486
<plugin>
466487
<groupId>org.codehaus.mojo</groupId>
467488
<artifactId>findbugs-maven-plugin</artifactId>
468-
<version>3.0.2</version>
489+
<version>3.0.3</version>
469490
<configuration>
470491
<effort>Max</effort>
471492
<threshold>Low</threshold>
@@ -484,7 +505,7 @@
484505
<plugin>
485506
<groupId>org.jacoco</groupId>
486507
<artifactId>jacoco-maven-plugin</artifactId>
487-
<version>0.7.6.201602180812</version>
508+
<version>0.7.7.201606060606</version>
488509
<executions>
489510
<execution>
490511
<goals>

src/main/java/com/github/dockerjava/jaxrs/DockerCmdExecFactoryImpl.java

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@
1818
import javax.ws.rs.client.WebTarget;
1919

2020
import com.github.dockerjava.api.command.UpdateContainerCmd;
21-
2221
import com.github.dockerjava.core.SSLConfig;
22+
2323
import org.apache.http.config.RegistryBuilder;
2424
import org.apache.http.conn.socket.ConnectionSocketFactory;
2525
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
2626
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
2727
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
2828
import org.glassfish.jersey.CommonProperties;
2929
import org.glassfish.jersey.apache.connector.ApacheClientProperties;
30+
import org.glassfish.jersey.apache.connector.ApacheConnectorProvider;
3031
import org.glassfish.jersey.client.ClientConfig;
3132
import org.glassfish.jersey.client.ClientProperties;
3233
import org.slf4j.Logger;
@@ -85,7 +86,6 @@
8586
import com.github.dockerjava.api.command.RenameContainerCmd;
8687
import com.github.dockerjava.api.exception.DockerClientException;
8788
import com.github.dockerjava.core.DockerClientConfig;
88-
import com.github.dockerjava.jaxrs.connector.ApacheConnectorProvider;
8989
import com.github.dockerjava.jaxrs.filter.JsonClientFilter;
9090
import com.github.dockerjava.jaxrs.filter.ResponseStatusExceptionFilter;
9191
import com.github.dockerjava.jaxrs.filter.SelectiveLoggingFilter;
@@ -115,6 +115,8 @@ public class DockerCmdExecFactoryImpl implements DockerCmdExecFactory {
115115

116116
private DockerClientConfig dockerClientConfig;
117117

118+
private PoolingHttpClientConnectionManager connManager = null;
119+
118120
@Override
119121
public void init(DockerClientConfig dockerClientConfig) {
120122
checkNotNull(dockerClientConfig, "config was not specified");
@@ -187,8 +189,21 @@ public void init(DockerClientConfig dockerClientConfig) {
187189
configureProxy(clientConfig, protocol);
188190
}
189191

190-
PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(getSchemeRegistry(
191-
originalUri, sslContext));
192+
connManager = new PoolingHttpClientConnectionManager(getSchemeRegistry(
193+
originalUri, sslContext)) {
194+
195+
@Override
196+
public void close() {
197+
super.shutdown();
198+
}
199+
200+
@Override
201+
public void shutdown() {
202+
// Disable shutdown of the pool. This will be done later, when this factory is closed
203+
// This is a workaround for finalize method on jerseys ClientRuntime which
204+
// closes the client and shuts down the connection pool when it is garbage collected
205+
}
206+
};
192207

193208
if (maxTotalConnections != null) {
194209
connManager.setMaxTotal(maxTotalConnections);
@@ -412,7 +427,6 @@ public KillContainerCmd.Exec createKillContainerCmdExec() {
412427
return new KillContainerCmdExec(getBaseResource(), getDockerClientConfig());
413428
}
414429

415-
416430
@Override
417431
public UpdateContainerCmd.Exec createUpdateContainerCmdExec() {
418432
return new UpdateContainerCmdExec(getBaseResource(), getDockerClientConfig());
@@ -527,6 +541,7 @@ public DisconnectFromNetworkCmd.Exec createDisconnectFromNetworkCmdExec() {
527541
public void close() throws IOException {
528542
checkNotNull(client, "Factory not initialized. You probably forgot to call init()!");
529543
client.close();
544+
connManager.close();
530545
}
531546

532547
public DockerCmdExecFactoryImpl withReadTimeout(Integer readTimeout) {

src/main/java/com/github/dockerjava/jaxrs/UnixConnectionSocketFactory.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
import java.net.URI;
3030

3131
import org.apache.http.HttpHost;
32-
import org.apache.http.annotation.Immutable;
32+
import org.apache.http.annotation.Contract;
33+
import org.apache.http.annotation.ThreadingBehavior;
3334
import org.apache.http.conn.ConnectTimeoutException;
3435
import org.apache.http.conn.socket.ConnectionSocketFactory;
3536
import org.apache.http.protocol.HttpContext;
@@ -38,7 +39,7 @@
3839
/**
3940
* Provides a ConnectionSocketFactory for connecting Apache HTTP clients to Unix sockets.
4041
*/
41-
@Immutable
42+
@Contract(threading = ThreadingBehavior.IMMUTABLE_CONDITIONAL)
4243
public class UnixConnectionSocketFactory implements ConnectionSocketFactory {
4344

4445
private File socketFile;

src/main/java/com/github/dockerjava/jaxrs/async/AbstractCallbackNotifier.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public Void call() throws Exception {
6161
}
6262

6363
try (InputStream inputStream = new WrappedResponseInputStream(response)) {
64+
6465
if (resultCallback != null) {
6566
responseStreamProcessor.processResponseStream(inputStream, resultCallback);
6667
}

0 commit comments

Comments
 (0)