Skip to content
Closed
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
12 changes: 6 additions & 6 deletions docker-java-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<instructions>
<Export-Package>com.github.dockerjava.api.*</Export-Package>
</instructions>
<bnd><![CDATA[
Export-Package: \
com.github.dockerjava.api.*
]]></bnd>
</configuration>
</plugin>
</plugins>
Expand Down
12 changes: 6 additions & 6 deletions docker-java-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<instructions>
<Export-Package>com.github.dockerjava.core.*</Export-Package>
</instructions>
<bnd><![CDATA[
Export-Package: \
com.github.dockerjava.core.*
]]></bnd>
</configuration>
</plugin>
<plugin>
Expand Down
27 changes: 20 additions & 7 deletions docker-java-transport-httpclient5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@
</exclusions>
</dependency>

<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.component.annotations</artifactId>
<version>1.5.0</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.metatype.annotations</artifactId>
<version>1.4.1</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
Expand All @@ -58,15 +72,14 @@
<skip>true</skip>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<instructions>
<Export-Package>com.github.dockerjava.httpclient5.*</Export-Package>
</instructions>
<bnd><![CDATA[
Export-Package: \
com.github.dockerjava.httpclient5.*
]]></bnd>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package com.github.dockerjava.httpclient5;

import java.io.IOException;
import java.net.URI;
import java.time.Duration;

import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
import org.osgi.service.metatype.annotations.ObjectClassDefinition;

import com.github.dockerjava.transport.DockerHttpClient;
import com.github.dockerjava.transport.DockerHttpClientType;

@DockerHttpClientType(value = OSGiApacheDockerHttpClientService.APACHE_HTTPCLIENT_5, transports = { DockerHttpClientType.TRANSPORT_STDIN_ATTACHMENT,
DockerHttpClientType.TRANSPORT_WINDOWS_NPIPE, DockerHttpClientType.TRANSPORT_UNIX_SOCKETS })
@Component(service = DockerHttpClient.class, immediate = true, name = OSGiApacheDockerHttpClientService.PID)
public class OSGiApacheDockerHttpClientService extends ApacheDockerHttpClientImpl {

static final String APACHE_HTTPCLIENT_5 = "apache.httpclient.5";
public static final String PID = "com.github.dockerjava.httpclient5.basic";

@ObjectClassDefinition(pid = PID)
@interface Config {
String dockerHost() default "localhost";

int maxConnections() default Integer.MAX_VALUE;;

long connectionTimeoutNanos() default -1;

long responseTimeoutNanos() default -1;
}

@Activate
protected OSGiApacheDockerHttpClientService(Config config) {
super(toDockerHost(config.dockerHost()), null, config.maxConnections(),
toDurationNanos(config.connectionTimeoutNanos()), toDurationNanos(config.responseTimeoutNanos()));
}

private static Duration toDurationNanos(long value) {
if (value < 0) {
return null;
}
return Duration.ofNanos(value);
}

private static URI toDockerHost(String config) {
return URI.create(config);
}

@Deactivate
public void deactivate() throws IOException {
close();
}

}
12 changes: 6 additions & 6 deletions docker-java-transport-jersey/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@
</plugin>

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<instructions>
<Export-Package>com.github.dockerjava.jaxrs.*</Export-Package>
</instructions>
<bnd><![CDATA[
Export-Package: \
com.github.dockerjava.jaxrs.*
]]></bnd>
</configuration>
</plugin>
</plugins>
Expand Down
12 changes: 6 additions & 6 deletions docker-java-transport-netty/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<instructions>
<Export-Package>com.github.dockerjava.netty.*</Export-Package>
</instructions>
<bnd><![CDATA[
Export-Package: \
com.github.dockerjava.netty.*
]]></bnd>
</configuration>
</plugin>
</plugins>
Expand Down
12 changes: 6 additions & 6 deletions docker-java-transport-okhttp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@
</plugin>

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<instructions>
<Export-Package>com.github.dockerjava.okhttp.*</Export-Package>
</instructions>
<bnd><![CDATA[
Export-Package: \
com.github.dockerjava.okhttp.*
]]></bnd>
</configuration>
</plugin>
</plugins>
Expand Down
12 changes: 6 additions & 6 deletions docker-java-transport-zerodep/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
</plugin>

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<instructions>
<Export-Package>com.github.dockerjava.zerodep.*</Export-Package>
</instructions>
<bnd><![CDATA[
Export-Package: \
com.github.dockerjava.zerodep.*
]]></bnd>
</configuration>
</plugin>

Expand Down
19 changes: 13 additions & 6 deletions docker-java-transport/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,25 @@
<version>5.8.0</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.component.annotations</artifactId>
<version>1.5.0</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<instructions>
<Export-Package>com.github.dockerjava.transport.*</Export-Package>
</instructions>
<bnd><![CDATA[
Export-Package: \
com.github.dockerjava.transport.*
]]></bnd>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.github.dockerjava.transport;

import org.osgi.service.component.annotations.ComponentPropertyType;

@ComponentPropertyType
public @interface DockerHttpClientType {

public static final String TRANSPORT_UNIX_SOCKETS = "unix.sockets";

public static final String TRANSPORT_WINDOWS_NPIPE = "windows.npipe";

public static final String TRANSPORT_STDIN_ATTACHMENT = "stdin.attacgment";

String value();

String[] transports();
}
25 changes: 18 additions & 7 deletions docker-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,27 @@
</plugin>

<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<instructions>
<Export-Package>!com.github.dockerjava.jaxrs.*,!com.github.dockerjava.netty.*,com.github.dockerjava.*</Export-Package>
<Import-Package>org.newsclub.net.unix;resolution:="optional",*</Import-Package>
</instructions>
<skip>false</skip>
<bnd><![CDATA[
-privatepackage: \
com.github.dockerjava.jaxrs.*,\
com.github.dockerjava.netty.*
Export-Package: \
com.github.dockerjava.api.*,\
com.github.dockerjava.core.*
Import-Package: \
!javax.annotation,\
!javax.net.ssl,\
!edu.umd.cs.findbugs.annotations\
org.newsclub.net.unix;resolution:="optional",\
*
]]></bnd>
</configuration>
</plugin>

</plugins>
</build>
</project>
44 changes: 35 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
<mockito.version>3.3.0</mockito.version>


<maven-jar-plugin.version>3.0.2</maven-jar-plugin.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<maven-release-plugin.version>3.0.0-M1</maven-release-plugin.version>
<maven-surefire-plugin.version>3.0.0-M4</maven-surefire-plugin.version>
Expand All @@ -105,6 +104,20 @@
<module>docker-java</module>
</modules>

<pluginRepositories>
<pluginRepository>
<id>bnd_snapshot_remove_after_release</id>
<url>https://bndtools.jfrog.io/bndtools/libs-snapshot/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<layout>default</layout>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories>

<build>
<pluginManagement>
<plugins>
Expand Down Expand Up @@ -153,11 +166,19 @@
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<version>6.3.0-SNAPSHOT</version>
<extensions>true</extensions>
<executions>
<execution>
<id>bnd-jar</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
<execution>
<id>bnd-test-jar</id>
<goals>
<goal>test-jar</goal>
</goals>
Expand Down Expand Up @@ -226,11 +247,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>4.2.1</version>
</plugin>


<plugin>
Expand Down Expand Up @@ -282,6 +298,16 @@
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<bnd><![CDATA[
Bundle-Name: ${project.name}
Bundle-SymbolicName: com.github.${project.name}
]]></bnd>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down