[GRADLE-3074] Gradle fails to parse a org.hornetq:hornetq-native:2.4.0.Final pom Created: 24/Apr/14  Updated: 03/Jul/14  Resolved: 05/Jun/14

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 2.1-rc-1

Type: Bug
Reporter: Gradle Forums Assignee: Benjamin Muschko
Resolution: Fixed Votes: 2


 Description   

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:
:test:unspecified
> Could not parse POM http://repo1.maven.org/maven2/org/hornetq/hornetq-native/2.4.0.Final/hornetq-native-2.4.0.Final.pom
> Illegal character in path at index 97: http://repo1.maven.org/maven2/org/hornetq/hornetq-native/2.4.0.Final/hornetq-native-2.4.0.Final.${native-package-type}

Maven parses it successfully.

build.gradle

apply plugin: 'java'

repositories {
mavenCentral()
}

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
Revision: 36ced393628875ff15575fa03d16c1349ffe8bb6

Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.9.2 compiled on July 8 2013
Ivy: 2.2.0
JVM: 1.7.0_45 (Oracle Corporation 24.45-b08)
OS: Mac OS X 10.9.1 x86_64



 Comments   
Comment by Gradle Forums [ 24/Apr/14 ]

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

Comment by Gradle Forums [ 24/Apr/14 ]

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.

Comment by Gradle Forums [ 24/Apr/14 ]

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.

<project>
...
<packaging>${native-package-type}</packaging>
...
<properties>
<native-package-type>jar</native-package-type>
</properties>
</project>

I raised an issue.

Comment by Matt Hurne [ 05/Jun/14 ]

Happy to see this is apparently fixed. Thanks!

Comment by Gary Russell [ 19/Jun/14 ]

Are there any plans to backport this to 1.x?

JIRA shows 2.1 (and 2.0) as unreleased.

It makes it difficult to use gradle to pull in hornetq (although patching the pom in the local gradle cache worked for me, it is not practical for software distribution).

Thanks

Comment by Luke Daley [ 19/Jun/14 ]

This won't be backported.

What you can do is use a nightly distribution (which is 2.1) which has the fix, until 2.1 comes out. Instructions are here: http://www.gradle.org/nightly

Generated at Wed Jun 30 12:39:12 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.