[GRADLE-3153] problems loading ivy metadata from dependency cache Created: 21/Aug/14  Updated: 01/Sep/14  Resolved: 01/Sep/14

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

Type: Bug
Reporter: Szczepan Faber Assignee: Adam Murdoch
Resolution: Fixed Votes: 0

Known Issue Of:

 Description   

After switching to 2.1-rc-1 I'm getting this error:

A problem occurred configuring root project 'network'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve commons-beanutils:commons-beanutils-core:1.8.0.
     Required by:
         :network:unspecified > ...
      > Could not parse Ivy file file:/home/sfaber/.gradle/caches/modules-2/metadata-2.12/descriptors/commons-beanutils/commons-beanutils-core/1.8.0/5fe57cbb80671d7a10d3443cc3cbaa96/ivy.xml
         > The prefix "ns0" for element "ns0:properties__organization.logo" is not bound.
   > Could not resolve commons-codec:commons-codec:1.4.
     Required by:
         :network:unspecified > ...
      > Could not parse Ivy file file:/home/sfaber/.gradle/caches/modules-2/metadata-2.12/descriptors/commons-codec/commons-codec/1.4/5fe57cbb80671d7a10d3443cc3cbaa96/ivy.xml
         > The prefix "ns0" for element "ns0:properties__commons.rc.version" is not bound.

The ivy file that exists in Gradle cache has following content:

...
<info organisation="commons-beanutils" module="commons-beanutils-core" revision="1.8.0" status="release" publication="20080831111344">
    <description homepage="http://commons.apache.org/beanutils/"/>
    <ns0:properties__organization.logo>http://www.apache.org/images/asf_logo_wide.gif</ns0:properties__organization.logo>
  </info>
...


 Comments   
Comment by Szczepan Faber [ 26/Aug/14 ]

I needed to axe the ~/.gradle dir (for different reasons than this bug) and this let me go pass this issue.

Comment by Adam Murdoch [ 28/Aug/14 ]

What does the ivy.xml/pom.xml look like in the repository? You're not using Maven Central, right?

Comment by Szczepan Faber [ 31/Aug/14 ]

Hey,

Thanks for looking into this issue!

The module in ivy repo looks this way: https://gist.github.com/szczepiq/f19692ef3d0c833642c3 It does not look correct because it contains namespaced node with a namespace prefix that is not declared in the xml. Gradle 2.1 resolves such module OK but does not seem to be able to reuse it correctly when Gradle 2.0 version has downloaded it before. Interestingly, 2.1 is able to reuse downloaded module from version 1.12 but not from 2.0. Other words, If someone upgrades from 1.12 to 2.1 he won't be exposed to this problem. Only if he upgrades from 2.0 it manifests itself.

Steps that demonstrate the problem:
1. Choose new gradle home dir to ensure the problem isolated
2. Build with 2.0. Downloads and resolves module "commons-beanutils-core"
3. Build again with the same settings, module is loaded from cache, resolution successful
4. Build with 2.1-rc-1, the problem is exposed
5. Try building with 2.1-rc-1 and --refresh-dependencies, the problem still persists
6. Downgrade to 2.0 and build, module loaded from cache, resolution successful
7. Nuke the gradle home dir, build with 2.1-rc-1, downloads and resolves ok
8. Build again, loads module from cache, resolution successful

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