Use maven plugin to prevent API/ABI breakage as part of build process (#8904)
Motivation: Netty is very widely used which can lead to a lot of pain when we break API / ABI. We should make use japicmp-maven-plugin during the build to verify we do not introduce breakage by mistake. Modifications: - Add japicmp-maven-plugin to the build process - Fix a method signature change in HttpProxyHandler that was flagged as a possible problem. Result: Ensure no API/ABI breakage accour between releases.
This commit is contained in:
parent
6f507dfeed
commit
14ef469f31
@ -31,6 +31,7 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<generatedSourceDir>${project.build.directory}/src</generatedSourceDir>
|
<generatedSourceDir>${project.build.directory}/src</generatedSourceDir>
|
||||||
<dependencyVersionsDir>${project.build.directory}/versions</dependencyVersionsDir>
|
<dependencyVersionsDir>${project.build.directory}/versions</dependencyVersionsDir>
|
||||||
|
<skipJapicmp>true</skipJapicmp>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
|
@ -57,7 +57,6 @@
|
|||||||
<groupId>${project.groupId}</groupId>
|
<groupId>${project.groupId}</groupId>
|
||||||
<artifactId>netty-handler</artifactId>
|
<artifactId>netty-handler</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<optional>true</optional>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.jcraft</groupId>
|
<groupId>com.jcraft</groupId>
|
||||||
|
@ -29,6 +29,9 @@
|
|||||||
|
|
||||||
<name>Netty/Example</name>
|
<name>Netty/Example</name>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<skipJapicmp>true</skipJapicmp>
|
||||||
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>${project.groupId}</groupId>
|
<groupId>${project.groupId}</groupId>
|
||||||
|
@ -172,7 +172,7 @@ public final class HttpProxyHandler extends ProxyHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean handleResponse(ChannelHandlerContext ctx, Object response) throws HttpProxyConnectException {
|
protected boolean handleResponse(ChannelHandlerContext ctx, Object response) throws Exception {
|
||||||
if (response instanceof HttpResponse) {
|
if (response instanceof HttpResponse) {
|
||||||
if (status != null) {
|
if (status != null) {
|
||||||
throw new HttpProxyConnectException(exceptionMessage("too many responses"), /*headers=*/ null);
|
throw new HttpProxyConnectException(exceptionMessage("too many responses"), /*headers=*/ null);
|
||||||
|
@ -38,8 +38,8 @@
|
|||||||
<!-- This only be set when run on mac as on other platforms we just want to include the jar without native
|
<!-- This only be set when run on mac as on other platforms we just want to include the jar without native
|
||||||
code -->
|
code -->
|
||||||
<kqueue.classifier />
|
<kqueue.classifier />
|
||||||
|
<skipJapicmp>true</skipJapicmp>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
<profile>
|
||||||
<id>linux</id>
|
<id>linux</id>
|
||||||
|
30
pom.xml
30
pom.xml
@ -289,6 +289,7 @@
|
|||||||
<skipOsgiTestsuite>false</skipOsgiTestsuite>
|
<skipOsgiTestsuite>false</skipOsgiTestsuite>
|
||||||
<skipAutobahnTestsuite>false</skipAutobahnTestsuite>
|
<skipAutobahnTestsuite>false</skipAutobahnTestsuite>
|
||||||
<skipHttp2Testsuite>false</skipHttp2Testsuite>
|
<skipHttp2Testsuite>false</skipHttp2Testsuite>
|
||||||
|
<skipJapicmp>false</skipJapicmp>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
@ -670,6 +671,35 @@
|
|||||||
</extensions>
|
</extensions>
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.github.siom79.japicmp</groupId>
|
||||||
|
<artifactId>japicmp-maven-plugin</artifactId>
|
||||||
|
<version>0.13.1</version>
|
||||||
|
<configuration>
|
||||||
|
<parameter>
|
||||||
|
<breakBuildOnBinaryIncompatibleModifications>true</breakBuildOnBinaryIncompatibleModifications>
|
||||||
|
<breakBuildOnSourceIncompatibleModifications>true</breakBuildOnSourceIncompatibleModifications>
|
||||||
|
<oldVersionPattern>\d+\.\d+\.\d+\.Final</oldVersionPattern>
|
||||||
|
<ignoreMissingClassesByRegularExpressions>
|
||||||
|
<!-- ignore everything which is not part of netty itself as the plugin can not handle optional dependencies -->
|
||||||
|
<ignoreMissingClassesByRegularExpression>^(?!io\.netty\.).*</ignoreMissingClassesByRegularExpression>
|
||||||
|
<ignoreMissingClassesByRegularExpression>^io\.netty\.internal\.tcnative\..*</ignoreMissingClassesByRegularExpression>
|
||||||
|
</ignoreMissingClassesByRegularExpressions>
|
||||||
|
<excludes>
|
||||||
|
<exclude>@io.netty.util.internal.UnstableApi</exclude>
|
||||||
|
</excludes>
|
||||||
|
</parameter>
|
||||||
|
<skip>${skipJapicmp}</skip>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>verify</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>cmp</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-enforcer-plugin</artifactId>
|
<artifactId>maven-enforcer-plugin</artifactId>
|
||||||
<version>${enforcer.plugin.version}</version>
|
<version>${enforcer.plugin.version}</version>
|
||||||
|
@ -28,6 +28,10 @@
|
|||||||
|
|
||||||
<name>Netty/Testsuite/Autobahn</name>
|
<name>Netty/Testsuite/Autobahn</name>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<skipJapicmp>true</skipJapicmp>
|
||||||
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>${project.groupId}</groupId>
|
<groupId>${project.groupId}</groupId>
|
||||||
|
@ -28,6 +28,10 @@
|
|||||||
|
|
||||||
<name>Netty/Testsuite/Http2</name>
|
<name>Netty/Testsuite/Http2</name>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<skipJapicmp>true</skipJapicmp>
|
||||||
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>${project.groupId}</groupId>
|
<groupId>${project.groupId}</groupId>
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<exam.version>4.13.0</exam.version>
|
<exam.version>4.13.0</exam.version>
|
||||||
<argLine.java9.extras>--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED</argLine.java9.extras>
|
<argLine.java9.extras>--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED</argLine.java9.extras>
|
||||||
|
<skipJapicmp>true</skipJapicmp>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
|
|
||||||
<jarName>${project.artifactId}-${project.version}.jar</jarName>
|
<jarName>${project.artifactId}-${project.version}.jar</jarName>
|
||||||
<shadedPackagePrefix>io.netty.</shadedPackagePrefix>
|
<shadedPackagePrefix>io.netty.</shadedPackagePrefix>
|
||||||
|
<skipJapicmp>true</skipJapicmp>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -104,6 +104,7 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<!-- Needed for SSL tests as these use the SelfSignedCertificate -->
|
<!-- Needed for SSL tests as these use the SelfSignedCertificate -->
|
||||||
<argLine.java9.extras>--add-exports java.base/sun.security.x509=ALL-UNNAMED</argLine.java9.extras>
|
<argLine.java9.extras>--add-exports java.base/sun.security.x509=ALL-UNNAMED</argLine.java9.extras>
|
||||||
|
<skipJapicmp>true</skipJapicmp>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
Loading…
Reference in New Issue
Block a user