Gradle fails to parse a org.hornetq:hornetq-native:2.4.0.Final pom

Gradle (tested 1.9 and 1.10) fails to parse a pom

Could not resolve all dependencies for configuration ':compile'.
> Could not resolve org.hornetq:hornetq-native:2.4.0.Final.
  Required by:
   > Could not parse POM
      > Illegal character in path at index 97:${native-package-type}

Maven parses it successfully.


apply plugin: 'java'
  repositories {
  dependencies {
    compile "org.hornetq:hornetq-native:2.4.0.Final"

gradle -version

Gradle 1.10
  Build time:
 2013-12-17 09:28:15 UTC
Build number: none
        Apache Ant(TM) version 1.9.2 compiled on July 8 2013
        1.7.0_45 (Oracle Corporation 24.45-b08)
         Mac OS X 10.9.1 x86_64

It seems, Gradle does not expand the property ‘${native-package-type}’ defined at the pom bottom when downloading the artifact.

Publishing POMs that haven’t had their profiles resolved is heavily discouraged, even by the Maven (Central) folks. Unfortunately, I’m not aware of a way to use such POMs from Gradle. If you have an internal repository, the best solution is to fix up the POM there.

I believe this is happening because the Gradle POM parsing doesn’t take into account property replacement for the ‘packaging’ attribute. A value for the property ‘native-package-type’ is also defined outside of a profile so this should generally work.


I raised an issue.

Great. Thanks.

This has been fixed for Gradle 2.1. You’ll be able to try this out with one of the nightly builds after the 2.0 final release.

It’s great. Thanks. I’ll try it out.