Skip to content

Commit 256035e

Browse files
committed
Added Clirr Maven Plugin to verify backwards compatibility
This plugin compares sources in `org.neo4j.driver.v1` package for backwards compatibility against previous (currently 1.2.0) driver version. Configuration currently permits adding new interface methods. Plugin reads exclusions from `clirr-ignored-differences.xml` file. It binds to `compile` Maven phase to perform verification.
1 parent b5cd774 commit 256035e

File tree

3 files changed

+70
-6
lines changed

3 files changed

+70
-6
lines changed

driver/clirr-ignored-differences.xml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<differences>
2+
3+
<difference>
4+
<!-- Method Added to Interface -->
5+
<differenceType>7012</differenceType>
6+
<className>org/neo4j/driver/v1/**</className>
7+
<method>*</method>
8+
<justification>
9+
Allow addition of methods to interfaces.
10+
Most interfaces are not expected to be implemented by users and expose driver APIs.
11+
</justification>
12+
</difference>
13+
14+
<difference>
15+
<!-- Method Argument Type changed -->
16+
<differenceType>7005</differenceType>
17+
<className>org/neo4j/driver/v1/Config$ConfigBuilder</className>
18+
<method>org.neo4j.driver.v1.Config$ConfigBuilder withLogging(org.neo4j.driver.internal.spi.Logging)</method>
19+
<to>org.neo4j.driver.v1.Config$ConfigBuilder withLogging(org.neo4j.driver.v1.Logging)</to>
20+
<justification>
21+
Logging interface initially lived in a private package but was exposed as part of public API.
22+
It was later moved to the correct public package.
23+
</justification>
24+
</difference>
25+
26+
<difference>
27+
<!-- Method Return Type changed -->
28+
<differenceType>7006</differenceType>
29+
<className>org/neo4j/driver/v1/Config</className>
30+
<method>org.neo4j.driver.internal.spi.Logging logging()</method>
31+
<to>org.neo4j.driver.v1.Logging</to>
32+
<justification>
33+
Logging interface initially lived in a private package but was exposed as part of public API.
34+
It was later moved to the correct public package.
35+
</justification>
36+
</difference>
37+
38+
</differences>

driver/pom.xml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@
101101
<target>1.7</target>
102102
</configuration>
103103
</plugin>
104+
<plugin>
105+
<groupId>org.codehaus.mojo</groupId>
106+
<artifactId>clirr-maven-plugin</artifactId>
107+
<configuration>
108+
<comparisonVersion>1.2.0</comparisonVersion>
109+
<includes>org/neo4j/driver/v1/**</includes>
110+
<ignoredDifferencesFile>clirr-ignored-differences.xml</ignoredDifferencesFile>
111+
</configuration>
112+
</plugin>
104113
<plugin>
105114
<groupId>org.apache.maven.plugins</groupId>
106115
<artifactId>maven-source-plugin</artifactId>
@@ -112,12 +121,12 @@
112121
</goals>
113122
<configuration>
114123
<archive>
115-
<manifestEntries>
116-
<Bundle-Name>${project.name} (Source)</Bundle-Name>
117-
<Bundle-SymbolicName>${bundle.name}.source</Bundle-SymbolicName>
118-
<Bundle-Version>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${build.timestamp}</Bundle-Version>
119-
<Eclipse-SourceBundle>${bundle.name};version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${build.timestamp}";roots:="."</Eclipse-SourceBundle>
120-
</manifestEntries>
124+
<manifestEntries>
125+
<Bundle-Name>${project.name} (Source)</Bundle-Name>
126+
<Bundle-SymbolicName>${bundle.name}.source</Bundle-SymbolicName>
127+
<Bundle-Version>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${build.timestamp}</Bundle-Version>
128+
<Eclipse-SourceBundle>${bundle.name};version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${build.timestamp}";roots:="."</Eclipse-SourceBundle>
129+
</manifestEntries>
121130
</archive>
122131
</configuration>
123132
</execution>

pom.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,23 @@
7575
</dependencyManagement>
7676

7777
<build>
78+
<pluginManagement>
79+
<plugins>
80+
<plugin>
81+
<groupId>org.codehaus.mojo</groupId>
82+
<artifactId>clirr-maven-plugin</artifactId>
83+
<version>2.8</version>
84+
<executions>
85+
<execution>
86+
<phase>compile</phase>
87+
<goals>
88+
<goal>check</goal>
89+
</goals>
90+
</execution>
91+
</executions>
92+
</plugin>
93+
</plugins>
94+
</pluginManagement>
7895
<plugins>
7996
<plugin>
8097
<groupId>com.mycila</groupId>

0 commit comments

Comments
 (0)