Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail build if netty-all pulls in duplicated classes #11804

Merged
merged 2 commits into from Oct 28, 2021
Merged

Conversation

normanmaurer
Copy link
Member

Motivation:

We should fail the build if netty-all pulls in dependencies that produce duplicated classes on the classpath

Modifications:

Add maven plugin to verify we not have duplicated classes on the classpath / dependencies

Result:

Related to #11791

Motivation:

We should fail the build if netty-all pulls in dependencies that produce duplicated classes on the classpath

Modifications:

Add maven plugin to verify we not have duplicated classes on the classpath / dependencies

Result:

Related to #11791
@normanmaurer
Copy link
Member Author

To test this I added some extra dependency that would cause the duplicated classes issue. The build fails with:

    ➜  netty git:(4.1) ✗ ./mvnw -pl all clean package
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Detecting the operating system and CPU architecture
[INFO] ------------------------------------------------------------------------
[INFO] os.detected.name: osx
[INFO] os.detected.arch: x86_64
[INFO] os.detected.bitness: 64
[INFO] os.detected.version: 10.16
[INFO] os.detected.version.major: 10
[INFO] os.detected.version.minor: 16
[INFO] os.detected.classifier: osx-x86_64
[INFO]
[INFO] -------------------------< io.netty:netty-all >-------------------------
[INFO] Building Netty/All-in-One 4.1.70.Final-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ netty-all ---
[INFO] Deleting /Users/norman/Documents/workspace/netty/all/target
[INFO]
[INFO] --- flatten-maven-plugin:1.2.2:clean (flatten.clean) @ netty-all ---
[INFO] Deleting /Users/norman/Documents/workspace/netty/all/.flattened-pom.xml
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-maven) @ netty-all ---
[INFO]
[INFO] --- maven-enforcer-plugin:3.0.0-M3:enforce (enforce-tools) @ netty-all ---
[INFO]
[INFO] --- maven-checkstyle-plugin:3.1.0:check (check-style) @ netty-all ---
[INFO] Starting audit...
Audit done.
[INFO]
[INFO] --- xml-maven-plugin:1.0.1:check-format (check-style) @ netty-all ---
[INFO]
[INFO] --- maven-dependency-plugin:2.10:get (get-jetty-alpn-agent) @ netty-all ---
[INFO] Resolving org.mortbay.jetty.alpn:jetty-alpn-agent:jar:2.0.10 with transitive dependencies
[INFO]
[INFO] --- build-helper-maven-plugin:1.10:parse-version (parse-version) @ netty-all ---
[INFO]
[INFO] --- duplicate-finder-maven-plugin:1.3.0:check (default) @ netty-all ---
[INFO] Checking compile classpath
[INFO] Checking runtime classpath
[WARNING] Found duplicate and different classes in [io.netty:netty-transport-classes-epoll:4.1.70.Final-SNAPSHOT, io.netty:netty-transport-native-epoll:4.1.69.Final]:
[WARNING]   io.netty.channel.epoll.AbstractEpollChannel
[WARNING]   io.netty.channel.epoll.AbstractEpollServerChannel
[WARNING]   io.netty.channel.epoll.AbstractEpollStreamChannel
[WARNING]   io.netty.channel.epoll.Epoll
[WARNING]   io.netty.channel.epoll.EpollChannelConfig
[WARNING]   io.netty.channel.epoll.EpollChannelOption
[WARNING]   io.netty.channel.epoll.EpollDatagramChannel
[WARNING]   io.netty.channel.epoll.EpollDatagramChannelConfig
[WARNING]   io.netty.channel.epoll.EpollDomainDatagramChannel
[WARNING]   io.netty.channel.epoll.EpollDomainDatagramChannelConfig
[WARNING]   io.netty.channel.epoll.EpollDomainSocketChannel
[WARNING]   io.netty.channel.epoll.EpollDomainSocketChannelConfig
[WARNING]   io.netty.channel.epoll.EpollEventArray
[WARNING]   io.netty.channel.epoll.EpollEventLoop
[WARNING]   io.netty.channel.epoll.EpollEventLoopGroup
[WARNING]   io.netty.channel.epoll.EpollMode
[WARNING]   io.netty.channel.epoll.EpollRecvByteAllocatorHandle
[WARNING]   io.netty.channel.epoll.EpollRecvByteAllocatorStreamingHandle
[WARNING]   io.netty.channel.epoll.EpollServerChannelConfig
[WARNING]   io.netty.channel.epoll.EpollServerDomainSocketChannel
[WARNING]   io.netty.channel.epoll.EpollServerSocketChannel
[WARNING]   io.netty.channel.epoll.EpollServerSocketChannelConfig
[WARNING]   io.netty.channel.epoll.EpollSocketChannel
[WARNING]   io.netty.channel.epoll.EpollSocketChannelConfig
[WARNING]   io.netty.channel.epoll.EpollTcpInfo
[WARNING]   io.netty.channel.epoll.LinuxSocket
[WARNING]   io.netty.channel.epoll.Native
[WARNING]   io.netty.channel.epoll.NativeDatagramPacketArray
[WARNING]   io.netty.channel.epoll.NativeStaticallyReferencedJniMethods
[WARNING]   io.netty.channel.epoll.SegmentedDatagramPacket
[WARNING]   io.netty.channel.epoll.TcpMd5Util
[WARNING] Found duplicate classes/resources in compile classpath.
[WARNING] Found duplicate and different classes in [io.netty:netty-transport-classes-epoll:4.1.70.Final-SNAPSHOT, io.netty:netty-transport-native-epoll:4.1.69.Final]:
[WARNING]   io.netty.channel.epoll.AbstractEpollChannel
[WARNING]   io.netty.channel.epoll.AbstractEpollServerChannel
[WARNING]   io.netty.channel.epoll.AbstractEpollStreamChannel
[WARNING]   io.netty.channel.epoll.Epoll
[WARNING]   io.netty.channel.epoll.EpollChannelConfig
[WARNING]   io.netty.channel.epoll.EpollChannelOption
[WARNING]   io.netty.channel.epoll.EpollDatagramChannel
[WARNING]   io.netty.channel.epoll.EpollDatagramChannelConfig
[WARNING]   io.netty.channel.epoll.EpollDomainDatagramChannel
[WARNING]   io.netty.channel.epoll.EpollDomainDatagramChannelConfig
[WARNING]   io.netty.channel.epoll.EpollDomainSocketChannel
[WARNING]   io.netty.channel.epoll.EpollDomainSocketChannelConfig
[WARNING]   io.netty.channel.epoll.EpollEventArray
[WARNING]   io.netty.channel.epoll.EpollEventLoop
[WARNING]   io.netty.channel.epoll.EpollEventLoopGroup
[WARNING]   io.netty.channel.epoll.EpollMode
[WARNING]   io.netty.channel.epoll.EpollRecvByteAllocatorHandle
[WARNING]   io.netty.channel.epoll.EpollRecvByteAllocatorStreamingHandle
[WARNING]   io.netty.channel.epoll.EpollServerChannelConfig
[WARNING]   io.netty.channel.epoll.EpollServerDomainSocketChannel
[WARNING]   io.netty.channel.epoll.EpollServerSocketChannel
[WARNING]   io.netty.channel.epoll.EpollServerSocketChannelConfig
[WARNING]   io.netty.channel.epoll.EpollSocketChannel
[WARNING]   io.netty.channel.epoll.EpollSocketChannelConfig
[WARNING]   io.netty.channel.epoll.EpollTcpInfo
[WARNING]   io.netty.channel.epoll.LinuxSocket
[WARNING]   io.netty.channel.epoll.Native
[WARNING]   io.netty.channel.epoll.NativeDatagramPacketArray
[WARNING]   io.netty.channel.epoll.NativeStaticallyReferencedJniMethods
[WARNING]   io.netty.channel.epoll.SegmentedDatagramPacket
[WARNING]   io.netty.channel.epoll.TcpMd5Util
[WARNING] Found duplicate classes/resources in runtime classpath.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.722 s
[INFO] Finished at: 2021-10-28T09:05:33+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.basepom.maven:duplicate-finder-maven-plugin:1.3.0:check (default) on project netty-all: Found duplicate classes/resources! -> [Help 1]

@normanmaurer normanmaurer added this to the 4.1.70.Final milestone Oct 28, 2021
all/pom.xml Outdated Show resolved Hide resolved
@normanmaurer normanmaurer merged commit baba1f4 into 4.1 Oct 28, 2021
@normanmaurer normanmaurer deleted the duplicate_check branch October 28, 2021 12:54
normanmaurer added a commit that referenced this pull request Oct 28, 2021
Motivation:

We should fail the build if netty-all pulls in dependencies that produce duplicated classes on the classpath

Modifications:

Add maven plugin to verify we not have duplicated classes on the classpath / dependencies

Result:

Related to #11791
laosijikaichele pushed a commit to laosijikaichele/netty that referenced this pull request Dec 16, 2021
Motivation:

We should fail the build if netty-all pulls in dependencies that produce duplicated classes on the classpath

Modifications:

Add maven plugin to verify we not have duplicated classes on the classpath / dependencies

Result:

Related to netty#11791
laosijikaichele pushed a commit to laosijikaichele/netty that referenced this pull request Dec 16, 2021
Motivation:

We should fail the build if netty-all pulls in dependencies that produce duplicated classes on the classpath

Modifications:

Add maven plugin to verify we not have duplicated classes on the classpath / dependencies

Result:

Related to netty#11791
raidyue pushed a commit to raidyue/netty that referenced this pull request Jul 8, 2022
Motivation:

We should fail the build if netty-all pulls in dependencies that produce duplicated classes on the classpath

Modifications:

Add maven plugin to verify we not have duplicated classes on the classpath / dependencies

Result:

Related to netty#11791
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants