netty: netty-all 4.1.64 has a broken dependency graph

Expected behavior

When maven compile (or install) runs on a maven project using both dependencies below, it should not generate errors with dependencies cannot be resolved.

Actual behavior

It generates errors such as:

ERROR] Failed to execute goal on project testNetty64: Could not resolve dependencies for project org.example:testNetty64:jar:1.0-SNAPSHOT: The following artifacts could not be resolved: io.netty:netty- tcnative:jar:${os.detected.classifier}:2.0.39.Final, io.netty:netty-transport-native- epoll:jar:${os.detected.name}-${os.detected.arch}:4.1.64.Final: Could not find artifact io.netty:netty- tcnative:jar:${os.detected.classifier}:2.0.39.Final in MavenCentral (https://repo.maven.apache.org/maven2) -> [Help 1]

Steps to reproduce

Simple pom.xml as below:

  <?xml version="1.0" encoding="UTF-8"?>
  <project xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>testNetty64</artifactId>
    <version>1.0-SNAPSHOT</version>
  
    <properties>
      <maven.compiler.source>8</maven.compiler.source>
      <maven.compiler.target>8</maven.compiler.target>
    </properties>
  
    <dependencies>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-all</artifactId>
        <version>4.1.64.Final</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-tcnative</artifactId>
        <version>2.0.39.Final</version>
      </dependency>
    </dependencies>
  </project>

maven clean compile

Netty version

Replacing 4.1.64-Final by 4.1.63-Final runs fine.

With 4.1.64-Final: mvn clean compile -U

  [INFO] ----------------------< org.example:testNetty64 >-----------------------
  [INFO] Building testNetty64 1.0-SNAPSHOT
  [INFO] --------------------------------[ jar ]---------------------------------
  Downloading from MavenCentral: https://repo.maven.apache.org/maven2/io/netty/netty-transport-native-epoll/4.1.64.Final/netty-transport-native-epoll-4.1.64.Final-$%7Bos.detected.name%7D-$%7Bos.detected.arch%7D.jar
  Downloading from MavenCentral: https://repo.maven.apache.org/maven2/io/netty/netty-tcnative/2.0.39.Final/netty-tcnative-2.0.39.Final-$%7Bos.detected.classifier%7D.jar
  Downloading from central: https://repo.maven.apache.org/maven2/io/netty/netty-tcnative/2.0.39.Final/netty-tcnative-2.0.39.Final-$%7Bos.detected.classifier%7D.jar
  Downloading from central: https://repo.maven.apache.org/maven2/io/netty/netty-transport-native-epoll/4.1.64.Final/netty-transport-native-epoll-4.1.64.Final-$%7Bos.detected.name%7D-$%7Bos.detected.arch%7D.jar
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time:  1.478 s
  [INFO] Finished at: 2021-05-18T09:35:23+02:00
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal on project testNetty64: Could not resolve dependencies for project org.example:testNetty64:jar:1.0-SNAPSHOT: 
  [The following artifacts could not be resolved: io.netty:netty-tcnative:jar:${os.detected.classifier}:2.0.39.Final, io.netty:netty-transport-native-epoll:jar:${os.detected.name}-${os.detected.arch}:4.1.64.Final: 
  [Could not find artifact io.netty:netty-tcnative:jar:${os.detected.classifier}:2.0.39.Final in MavenCentral (https://repo.maven.apache.org/maven2) -> [Help 1]

In DEBUG mode, I’ve got the following possibly useful elements: mvn clean compile -e -X -U

  Apache Maven 3.6.3
  Maven home: /usr/share/maven
  Java version: 11.0.11, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
  Default locale: fr_FR, platform encoding: UTF-8
  OS name: "linux", version: "5.4.0-73-generic", arch: "amd64", family: "unix"
  ...
  [DEBUG] =======================================================================
  [DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=974120, ConflictMarker.markTime=382215, 
  ConflictMarker.nodeCount=158, ConflictIdSorter.graphTime=782831, ConflictIdSorter.topsortTime=386305, 
  ConflictIdSorter.conflictIdCount=44, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=7735894, 
  ConflictResolver.conflictItemCount=157, DefaultDependencyCollector.collectTime=208052123, 
  DefaultDependencyCollector.transformTime=11590815}
  [DEBUG] org.example:testNetty64:jar:1.0-SNAPSHOT
  [DEBUG]    io.netty:netty-all:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-buffer:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-codec:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-codec-dns:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-codec-haproxy:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-codec-http:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-codec-http2:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-codec-memcache:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-codec-mqtt:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-codec-redis:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-codec-smtp:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-codec-socks:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-codec-stomp:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-codec-xml:jar:4.1.64.Final:compile
  [DEBUG]          com.fasterxml:aalto-xml:jar:1.0.0:compile
  [DEBUG]             org.codehaus.woodstox:stax2-api:jar:4.0.0:compile
  [DEBUG]       io.netty:netty-common:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-handler:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-handler-proxy:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-resolver:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-resolver-dns:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-transport:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-transport-rxtx:jar:4.1.64.Final:compile
  [DEBUG]          org.rxtx:rxtx:jar:2.1.7:compile
  [DEBUG]       io.netty:netty-transport-sctp:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-transport-udt:jar:4.1.64.Final:compile
  [DEBUG]          com.barchart.udt:barchart-udt-bundle:jar:2.3.0:compile
  [DEBUG]       io.netty:netty-example:jar:4.1.64.Final:compile
  [DEBUG]          com.google.protobuf:protobuf-java:jar:2.6.1:compile
  [DEBUG]          io.netty:netty-tcnative:jar:${os.detected.classifier}:2.0.39.Final:compile
  [DEBUG]          org.conscrypt:conscrypt-openjdk-uber:jar:2.5.2:compile
  [DEBUG]          com.jcraft:jzlib:jar:1.1.3:runtime
  [DEBUG]          com.yammer.metrics:metrics-core:jar:2.2.0:compile
  [DEBUG]             org.slf4j:slf4j-api:jar:1.7.2:compile
  [DEBUG]          ch.qos.logback:logback-classic:jar:1.1.7:runtime
  [DEBUG]             ch.qos.logback:logback-core:jar:1.1.7:runtime
  [DEBUG]          org.bouncycastle:bcpkix-jdk15on:jar:1.68:compile
  [DEBUG]          org.bouncycastle:bcprov-jdk15on:jar:1.68:compile
  [DEBUG]          com.sun.activation:javax.activation:jar:1.2.0:compile
  [DEBUG]       io.netty:netty-transport-native-epoll:jar:${os.detected.name}-${os.detected.arch}:4.1.64.Final:compile
  [DEBUG]          io.netty:netty-transport-native-unix-common:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-transport-native-kqueue:jar:4.1.64.Final:compile
  [DEBUG]       io.netty:netty-resolver-dns-native-macos:jar:4.1.64.Final:compile
  [DEBUG]    io.netty:netty-tcnative:jar:2.0.39.Final:compile
  [DEBUG] Using transporter WagonTransporter with priority -1.0 for https://repo.maven.apache.org/maven2
  [DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://repo.maven.apache.org/maven2
  [[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://repo.maven.apache.org/maven2
  [[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://repo.maven.apache.org/maven2
  [Downloading from MavenCentral: https://repo.maven.apache.org/maven2/io/netty/netty-tcnative/2.0.39.Final/netty-tcnative-2.0.39.Final-$%7Bos.detected.classifier%7D.jar
  [Downloading from MavenCentral: https://repo.maven.apache.org/maven2/io/netty/netty-transport-native-epoll/4.1.64.Final/netty-transport-native-epoll-4.1.64.Final-$%7Bos.detected.name%7D-$%7Bos.detected.arch%7D.jar
  [[DEBUG] Writing tracking file /home/frederic/.m2/repository/io/netty/netty-tcnative/2.0.39.Final/netty-tcnative-2.0.39.Final-${os.detected.classifier}.jar.lastUpdated
  [[DEBUG] Writing tracking file /home/frederic/.m2/repository/io/netty/netty-transport-native-epoll/4.1.64.Final/netty-transport-native-epoll-4.1.64.Final-${os.detected.name}-${os.detected.arch}.jar.lastUpdated
  [[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://repo.maven.apache.org/maven2
  [[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://repo.maven.apache.org/maven2
  [Downloading from central: https://repo.maven.apache.org/maven2/io/netty/netty-tcnative/2.0.39.Final/netty-tcnative-2.0.39.Final-$%7Bos.detected.classifier%7D.jar
  [Downloading from central: https://repo.maven.apache.org/maven2/io/netty/netty-transport-native-epoll/4.1.64.Final/netty-transport-native-epoll-4.1.64.Final-$%7Bos.detected.name%7D-$%7Bos.detected.arch%7D.jar
  [[DEBUG] Writing tracking file /home/frederic/.m2/repository/io/netty/netty-tcnative/2.0.39.Final/netty-tcnative-2.0.39.Final-${os.detected.classifier}.jar.lastUpdated
  [[DEBUG] Writing tracking file /home/frederic/.m2/repository/io/netty/netty-transport-native-epoll/4.1.64.Final/netty-transport-native-epoll-4.1.64.Final-${os.detected.name}-${os.detected.arch}.jar.lastUpdated
  [[INFO] ------------------------------------------------------------------------
  [[INFO] BUILD FAILURE
  [[INFO] ------------------------------------------------------------------------
  [[INFO] Total time:  6.177 s
  [[INFO] Finished at: 2021-05-18T09:31:45+02:00
  [[INFO] ------------------------------------------------------------------------
  [[ERROR] Failed to execute goal on project testNetty64: Could not resolve dependencies for project org.example:testNetty64:jar:1.0-SNAPSHOT
  [: The following artifacts could not be resolved: io.netty:netty-tcnative:jar:${os.detected.classifier}:2.0.39.Final, io.netty:netty-transport-native-epoll:jar:${os.detected.name}-${os.detected.arch}:4.1.64.Final: 
  [Could not find artifact io.netty:netty-tcnative:jar:${os.detected.classifier}:2.0.39.Final in MavenCentral (https://repo.maven.apache.org/maven2) -> [Help 1]

JVM version (e.g. java -version)

Tried using Java 8 and Java 11

  java version "1.8.0_221"
  Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
  Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)

  openjdk version "11.0.11" 2021-04-20
  OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2.20.04)
  OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2.20.04, mixed mode, sharing)

OS version (e.g. uname -a)

  Linux frederic-X510UQ 5.4.0-73-generic #82-Ubuntu SMP Wed Apr 14 17:39:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 19 (19 by maintainers)

Commits related to this issue

Most upvoted comments

@boris-unckel hopefully this week

Here’s the result of running mvn dependency:tree on the pom.xml from the description against netty with #11278: tree.txt As far as I can tell, the tree output looks good.

@candrews @normanmaurer actually the correct thing would be to not use os-maven-plugin at all for these. This gives you information about the OS/arch of the build system which is irrelevant to the artifacts being published. The classifier for the epoll and tcnative dependencies should just be explicitly set to linux-x86_64. See #8097.

That makes a lot of sense to me, thank you! Here’s a PR making that change: https://github.com/netty/netty/pull/11278

With #11278, the test case given in the description (running mvn compile for the simple pom.xml) passes.