Skip to content

Commit 0e4b1a7

Browse files
authored
Add japicmp to the API module and fix backward compatibility issues (docker-java#1310)
* Add automated japicmp to the API module * restore backward incompatible removal of `Volume.parse(String)`
1 parent 4b303af commit 0e4b1a7

2 files changed

Lines changed: 71 additions & 0 deletions

File tree

docker-java-api/pom.xml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,64 @@
5555
</instructions>
5656
</configuration>
5757
</plugin>
58+
59+
<plugin>
60+
<!-- use with "mvn -DskipTests clean verify" -->
61+
<groupId>com.github.siom79.japicmp</groupId>
62+
<artifactId>japicmp-maven-plugin</artifactId>
63+
<version>0.14.3</version>
64+
<configuration>
65+
<oldVersion>
66+
<dependency>
67+
<groupId>com.github.docker-java</groupId>
68+
<artifactId>docker-java</artifactId>
69+
<version>3.1.5</version>
70+
<type>jar</type>
71+
</dependency>
72+
</oldVersion>
73+
<newVersion>
74+
<file>
75+
<path>${project.build.directory}/${project.artifactId}-${project.version}.jar</path>
76+
</file>
77+
</newVersion>
78+
<parameter>
79+
<breakBuildOnBinaryIncompatibleModifications>true</breakBuildOnBinaryIncompatibleModifications>
80+
<accessModifier>public</accessModifier>
81+
<onlyBinaryIncompatible>true</onlyBinaryIncompatible>
82+
<includes>
83+
<include>com.github.dockerjava.api</include>
84+
</includes>
85+
<excludes>
86+
<!-- TODO? -->
87+
<exclude>com.github.dockerjava.api.model.*$Serializer</exclude>
88+
<exclude>com.github.dockerjava.api.model.*$Deserializer</exclude>
89+
<!-- Known 3.2.0 breaking changes: -->
90+
<exclude>com.github.dockerjava.api.command.DockerCmdExecFactory#init(com.github.dockerjava.core.DockerClientConfig)</exclude>
91+
<exclude>com.github.dockerjava.api.model.Identifier#tag</exclude>
92+
</excludes>
93+
<overrideCompatibilityChangeParameters>
94+
<overrideCompatibilityChangeParameter>
95+
<compatibilityChange>METHOD_NEW_DEFAULT</compatibilityChange>
96+
<binaryCompatible>true</binaryCompatible>
97+
<sourceCompatible>true</sourceCompatible>
98+
</overrideCompatibilityChangeParameter>
99+
<overrideCompatibilityChangeParameter>
100+
<compatibilityChange>METHOD_ABSTRACT_NOW_DEFAULT</compatibilityChange>
101+
<binaryCompatible>true</binaryCompatible>
102+
<sourceCompatible>true</sourceCompatible>
103+
</overrideCompatibilityChangeParameter>
104+
</overrideCompatibilityChangeParameters>
105+
</parameter>
106+
</configuration>
107+
<executions>
108+
<execution>
109+
<phase>verify</phase>
110+
<goals>
111+
<goal>cmp</goal>
112+
</goals>
113+
</execution>
114+
</executions>
115+
</plugin>
58116
</plugins>
59117
</build>
60118
</project>

docker-java-api/src/main/java/com/github/dockerjava/api/model/Volume.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.github.dockerjava.api.model;
22

33
import com.fasterxml.jackson.annotation.JsonCreator;
4+
import com.fasterxml.jackson.annotation.JsonProperty;
45
import com.fasterxml.jackson.annotation.JsonValue;
56
import lombok.EqualsAndHashCode;
67

@@ -24,6 +25,18 @@
2425
public class Volume implements Serializable {
2526
private static final long serialVersionUID = 1L;
2627

28+
/**
29+
* Handles the {@code { "Destination" : { "path" : "/path/to/mount" } }} variant.
30+
* @param path the destination path of the bind mounted volume
31+
* @return a volume instance referring to the given path.
32+
* @deprecated use {@link #parse(Map)}
33+
*/
34+
@Nonnull
35+
@Deprecated
36+
public static Volume parse(@JsonProperty("path") String path) {
37+
return new Volume(path);
38+
}
39+
2740
/**
2841
* Handles the {@code { "Destination" : { "path" : "/path/to/mount" } }} variant.
2942
* @param path the destination path of the bind mounted volume

0 commit comments

Comments
 (0)