siom79 / japicmp

Comparison of two versions of a jar archive
https://siom79.github.io/japicmp
Apache License 2.0
694 stars 107 forks source link

incompatibility reported even excludes with annotations. #394

Closed He-Pin closed 3 months ago

He-Pin commented 3 months ago

Error: Failed to execute goal com.github.siom79.japicmp:japicmp-maven-plugin:0.15.7:cmp (default) on project netty-codec-http2: There is at least one incompatibility: io.netty.handler.codec.http2.AbstractHttp2StreamFrame:METHOD_ABSTRACT_ADDED_IN_IMPLEMENTED_INTERFACE,io.netty.handler.codec.http2.Http2Frame.frameType():METHOD_ADDED_TO_INTERFACE -> [Help 1] Error:

Version 0.15.7, same in 0.20.0

The method was marked with

           <excludes>
              <exclude>@io.netty.util.internal.UnstableApi</exclude>
              <exclude>io.netty.util.internal.shaded</exclude>
            </excludes>

but still be reported during the maven verify

import io.netty.util.internal.UnstableApi;

/** An HTTP/2 frame. */
@UnstableApi
public interface Http2Frame {

    /**
     * Returns the type of the HTTP/2 frame e.g. DATA, GOAWAY, etc.
     */
    byte frameType();

    /**
     * Returns the name of the HTTP/2 frame e.g. DATA, GOAWAY, etc.
     */
    String name();
}

related issue: https://github.com/netty/netty/pull/13989

siom79 commented 3 months ago

Hello, thanks for reporting.

Have you tried the option breakBuildIfCausedByExclusion? The exclude option otherwise only affects the reporting, not the breaking of the build.

siom79 commented 3 months ago

During investigation I realized that there was an issue with annotation loading of classes. Hence, I fixed this in this context.

siom79 commented 3 months ago

Released with 0.21.0.