Search code examples
javamavenantnettyivy

Downloading Netty through Ivy dependency resolution fails


I'm trying to use Ivy inside Ant to resolve the dependencies for my project, one of which is Netty.

My current ivy.xml looks like this:

<ivy-module version="2.4">
  <info organisation="foo" module="bar"/>

  <dependencies>
    <dependency org="io.netty" name="netty-all" rev="4.0.30.Final"/>
  </dependencies>
</ivy-module>

When I execute <ivy:retrieve/>, in my build.xml, I get the following output:

download-ivy:
     [echo] Downloading ivy to /home/emichael/.ant/lib...
    [mkdir] Created dir: /home/emichael/.ant/lib
      [get] Getting: http://repo2.maven.org/maven2/org/apache/ivy/ivy/2.4.0/ivy-2.4.0.jar
      [get] To: /home/emichael/.ant/lib/ivy.jar

init-ivy:

resolve:
[ivy:retrieve] :: Apache Ivy 2.4.0 - 20141213170938 :: http://ant.apache.org/ivy/ ::
[ivy:retrieve] :: loading settings :: url = jar:file:/home/emichael/.ant/lib/ivy.jar!/org/apache/ivy/core/settings/ivysettings.xml
[ivy:retrieve] :: resolving dependencies :: com.ellismichael#scalableagreement;working@fortuna
[ivy:retrieve]  confs: [default]
[ivy:retrieve]  found io.netty#netty-all;4.0.30.Final in public
[ivy:retrieve]  found io.netty#netty-buffer;4.0.30.Final in public
[ivy:retrieve]  found io.netty#netty-common;4.0.30.Final in public
[ivy:retrieve]  found io.netty#netty-codec;4.0.30.Final in public
[ivy:retrieve]  found io.netty#netty-transport;4.0.30.Final in public
[ivy:retrieve]  found io.netty#netty-codec-haproxy;4.0.30.Final in public
[ivy:retrieve]  found io.netty#netty-codec-http;4.0.30.Final in public
[ivy:retrieve]  found io.netty#netty-handler;4.0.30.Final in public
[ivy:retrieve]  found io.netty#netty-codec-socks;4.0.30.Final in public
[ivy:retrieve]  found io.netty#netty-transport-rxtx;4.0.30.Final in public
[ivy:retrieve]  found org.rxtx#rxtx;2.1.7 in public
[ivy:retrieve]  found io.netty#netty-transport-sctp;4.0.30.Final in public
[ivy:retrieve]  found io.netty#netty-transport-udt;4.0.30.Final in public
[ivy:retrieve]  found com.barchart.udt#barchart-udt-bundle;2.3.0 in public
[ivy:retrieve]  found io.netty#netty-example;4.0.30.Final in public
[ivy:retrieve]  found com.google.protobuf#protobuf-java;2.5.0 in public
[ivy:retrieve]  found io.netty#netty-tcnative;1.1.33.Fork4 in public
[ivy:retrieve]  found org.eclipse.jetty.npn#npn-api;1.1.1.v20141010 in public
[ivy:retrieve]  found com.yammer.metrics#metrics-core;2.2.0 in public
[ivy:retrieve]  found org.slf4j#slf4j-api;1.7.5 in public
[ivy:retrieve]  found org.jboss.marshalling#jboss-marshalling;1.3.18.GA in public
[ivy:retrieve]  found commons-logging#commons-logging;1.1.3 in public
[ivy:retrieve]  found log4j#log4j;1.2.17 in public
[ivy:retrieve] downloading https://repo1.maven.org/maven2/io/netty/netty-all/4.0.30.Final/netty-all-4.0.30.Final-sources.jar ...
[ivy:retrieve] ....................................................................................................... (1621kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] io.netty#netty-all;4.0.30.Final!netty-all.jar(source) (397ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/io/netty/netty-all/4.0.30.Final/netty-all-4.0.30.Final-javadoc.jar ...
[ivy:retrieve] ........................................................................................................................................................................................................................................................................................ (4453kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] io.netty#netty-all;4.0.30.Final!netty-all.jar(javadoc) (361ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/io/netty/netty-all/4.0.30.Final/netty-all-4.0.30.Final.jar ...
[ivy:retrieve] ................................................................................................................................. (2009kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] io.netty#netty-all;4.0.30.Final!netty-all.jar (166ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/io/netty/netty-buffer/4.0.30.Final/netty-buffer-4.0.30.Final.jar ...
[ivy:retrieve] ............. (185kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] io.netty#netty-buffer;4.0.30.Final!netty-buffer.jar (105ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/io/netty/netty-codec/4.0.30.Final/netty-codec-4.0.30.Final.jar ...
[ivy:retrieve] .......... (141kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] io.netty#netty-codec;4.0.30.Final!netty-codec.jar (93ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/io/netty/netty-codec-haproxy/4.0.30.Final/netty-codec-haproxy-4.0.30.Final.jar ...
[ivy:retrieve] ... (19kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] io.netty#netty-codec-haproxy;4.0.30.Final!netty-codec-haproxy.jar (88ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/io/netty/netty-codec-http/4.0.30.Final/netty-codec-http-4.0.30.Final.jar ...
[ivy:retrieve] ............................ (429kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] io.netty#netty-codec-http;4.0.30.Final!netty-codec-http.jar (105ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/io/netty/netty-codec-socks/4.0.30.Final/netty-codec-socks-4.0.30.Final.jar ...
[ivy:retrieve] ..... (48kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] io.netty#netty-codec-socks;4.0.30.Final!netty-codec-socks.jar (87ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/io/netty/netty-common/4.0.30.Final/netty-common-4.0.30.Final.jar ...
[ivy:retrieve] ............................ (426kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] io.netty#netty-common;4.0.30.Final!netty-common.jar (123ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/io/netty/netty-handler/4.0.30.Final/netty-handler-4.0.30.Final.jar ...
[ivy:retrieve] ................. (243kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] io.netty#netty-handler;4.0.30.Final!netty-handler.jar (102ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/io/netty/netty-transport/4.0.30.Final/netty-transport-4.0.30.Final.jar ...
[ivy:retrieve] ...................... (335kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] io.netty#netty-transport;4.0.30.Final!netty-transport.jar (100ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/io/netty/netty-transport-rxtx/4.0.30.Final/netty-transport-rxtx-4.0.30.Final.jar ...
[ivy:retrieve] ... (17kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] io.netty#netty-transport-rxtx;4.0.30.Final!netty-transport-rxtx.jar (88ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/io/netty/netty-transport-sctp/4.0.30.Final/netty-transport-sctp-4.0.30.Final.jar ...
[ivy:retrieve] ..... (47kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] io.netty#netty-transport-sctp;4.0.30.Final!netty-transport-sctp.jar (87ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/io/netty/netty-transport-udt/4.0.30.Final/netty-transport-udt-4.0.30.Final.jar ...
[ivy:retrieve] ... (28kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] io.netty#netty-transport-udt;4.0.30.Final!netty-transport-udt.jar (89ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/io/netty/netty-example/4.0.30.Final/netty-example-4.0.30.Final.jar ...
[ivy:retrieve] .................... (291kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] io.netty#netty-example;4.0.30.Final!netty-example.jar (99ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/2.5.0/protobuf-java-2.5.0.jar ...
[ivy:retrieve] .................................. (520kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] com.google.protobuf#protobuf-java;2.5.0!protobuf-java.jar(bundle) (111ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/org/jboss/marshalling/jboss-marshalling/1.3.18.GA/jboss-marshalling-1.3.18.GA.jar ...
[ivy:retrieve] ................ (228kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] org.jboss.marshalling#jboss-marshalling;1.3.18.GA!jboss-marshalling.jar (95ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.5/slf4j-api-1.7.5.jar ...
[ivy:retrieve] ... (25kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] org.slf4j#slf4j-api;1.7.5!slf4j-api.jar (86ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar ...
[ivy:retrieve] ..... (60kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] commons-logging#commons-logging;1.1.3!commons-logging.jar (89ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/log4j/log4j/1.2.17/log4j-1.2.17.jar ...
[ivy:retrieve] ............................... (478kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] log4j#log4j;1.2.17!log4j.jar(bundle) (134ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/org/rxtx/rxtx/2.1.7/rxtx-2.1.7.jar ...
[ivy:retrieve] ..... (58kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] org.rxtx#rxtx;2.1.7!rxtx.jar (87ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/com/barchart/udt/barchart-udt-bundle/2.3.0/barchart-udt-bundle-2.3.0.jar ...
[ivy:retrieve] ................................................................................................................ (1774kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] com.barchart.udt#barchart-udt-bundle;2.3.0!barchart-udt-bundle.jar(bundle) (170ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/org/eclipse/jetty/npn/npn-api/1.1.1.v20141010/npn-api-1.1.1.v20141010.jar ...
[ivy:retrieve] .. (5kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] org.eclipse.jetty.npn#npn-api;1.1.1.v20141010!npn-api.jar (87ms)
[ivy:retrieve] downloading https://repo1.maven.org/maven2/com/yammer/metrics/metrics-core/2.2.0/metrics-core-2.2.0.jar ...
[ivy:retrieve] ....... (80kB)
[ivy:retrieve] .. (0kB)
[ivy:retrieve]  [SUCCESSFUL ] com.yammer.metrics#metrics-core;2.2.0!metrics-core.jar (89ms)
[ivy:retrieve] :: resolution report :: resolve 12177ms :: artifacts dl 3111ms
    ---------------------------------------------------------------------
    |                  |            modules            ||   artifacts   |
    |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
    ---------------------------------------------------------------------
    |      default     |   23  |   23  |   23  |   0   ||   25  |   24  |
    ---------------------------------------------------------------------
[ivy:retrieve] 
[ivy:retrieve] :: problems summary ::
[ivy:retrieve] :::: WARNINGS
[ivy:retrieve]      [FAILED     ] io.netty#netty-tcnative;1.1.33.Fork4!netty-tcnative.jar:  (0ms)
[ivy:retrieve]  ==== shared: tried
[ivy:retrieve]    /home/emichael/.ant/shared/io.netty/netty-tcnative/1.1.33.Fork4/jars/netty-tcnative.jar
[ivy:retrieve]  ==== public: tried
[ivy:retrieve]    https://repo1.maven.org/maven2/io/netty/netty-tcnative/1.1.33.Fork4/netty-tcnative-1.1.33.Fork4-${os.detected.classifier}.jar
[ivy:retrieve]      ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]      ::              FAILED DOWNLOADS            ::
[ivy:retrieve]      :: ^ see resolution messages for details  ^ ::
[ivy:retrieve]      ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve]      :: io.netty#netty-tcnative;1.1.33.Fork4!netty-tcnative.jar
[ivy:retrieve]      ::::::::::::::::::::::::::::::::::::::::::::::
[ivy:retrieve] 
[ivy:retrieve] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS

BUILD FAILED

The issue appears to be that ${os.detected.classifier} is not defined. At least, that's the only thing that makes sense to me since https://repo1.maven.org/maven2/io/netty/netty-tcnative/1.1.33.Fork4/ definitely exists and definitely has lots of jars. Googling os.detected.classifier didn't yield much except a link to the netty-tcnative project, but it appears that netty is using some maven plugin in their dependency resolution. It getting netty through Ivy even possible, or is there something I'm not doing right?

Also, strangely enough, depending solely on

<dependency org="io.netty" name="netty-tcnative" rev="1.1.33.Fork4"/>

resolves just fine, but depending on

<dependency org="io.netty" name="netty-tcnative" rev="1.1.33.Fork4"/>
<dependency org="io.netty" name="netty-all" rev="4.0.30.Final"/>

fails.


Solution

  • The problem is that ivy did not understand the optional tag in the netty-tcnative dependency (see parent pom). Maven would not try to download this and if you want this you have to add it yourself and then need to define the classifier. Since ivy did not understand this you need to add this as exclude:

    <dependency org="io.netty" name="netty-all" rev="4.0.30.Final">
        <exclude org="io.netty" name="netty-tcnative"/>
    </dependency>