Search code examples
ivyrestletdependency-management

IVY: Cannot resolve restlet dependency


I have a java project setup and wanted to use ivy as dependency management tool. However, I could not get the simplest one to work.

Here is the code I have:

ivy.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
    <info
        organisation="de.fau.fsahoy"
        module="de.fau.fsahoy.android.api15"
        status="integration">
    </info>

    <dependencies>
        <dependency org="org.restlet.android" name="org.restlet" rev="2.1-RC5"/>
    </dependencies>
</ivy-module>

ivysettings.xml

<?xml version="1.0"?>
<ivysettings >
    <settings defaultResolver="maven" />
    <resolvers>
        <chain name="maven" returnFirst="true">
            <ibiblio name="restlet" m2compatible="true" root="http://maven.restlet.org/" />
        </chain>
    </resolvers>

</ivysettings>

The errors I get are:

Impossible to resolve dependencies of de.fau.fsahoy#de.fau.fsahoy.android.api15;working@JonasErl-PC

Failed to load the descriptor for ivysettings.xml[*] in fsahoy-team-d-gitThe ivy file 'C:\Users\JonasErl\Code\fsahoy-team-d-git\ivysettings.xml' could not be parsed: null in file:/C:/Users/JonasErl/Code/fsahoy-team-d-git/ivysettings.xml


org.apache.ivyde.eclipse.IvyDEException: The ivy file 'C:\Users\JonasErl\Code\fsahoy-team-d-git\ivysettings.xml' could not be parsed: null in file:/C:/Users/JonasErl/Code/fsahoy-team-d-git/ivysettings.xml
    at org.apache.ivyde.eclipse.CachedIvy.getModuleDescriptor(CachedIvy.java:376)
    at org.apache.ivyde.eclipse.resolve.IvyResolveJob.run(IvyResolveJob.java:137)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.text.ParseException: null in file:/C:/Users/JonasErl/Code/fsahoy-team-d-git/ivysettings.xml
    at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser$Parser.parse(XmlModuleDescriptorParser.java:301)
    at org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser.parseDescriptor(XmlModuleDescriptorParser.java:116)
    at org.apache.ivy.plugins.parser.ModuleDescriptorParserRegistry.parseDescriptor(ModuleDescriptorParserRegistry.java:88)
    at org.apache.ivy.plugins.parser.AbstractModuleDescriptorParser.parseDescriptor(AbstractModuleDescriptorParser.java:48)
    at org.apache.ivyde.eclipse.CachedIvy.getModuleDescriptor(CachedIvy.java:368)
    ... 2 more
Caused by: java.lang.NullPointerException

You can have a look at the repository structure at maven.restlet.org

These errormessages are not the very best unfortunately. How can I fix this?


Solution

  • I could not reproduce your error....

    • What version of ivy are you using?
    • How are you invoking the ivy tasks?

    Test

    build.xml

    <project name="demo" default="init" xmlns:ivy="antlib:org.apache.ivy.ant">
    
        <target name="init">
            <ivy:resolve/>
        </target>
    
        <target name="clean">
            <ivy:cleancache/>
        </target>
    
    </project>
    

    Build output

    init:
    [ivy:resolve] :: Apache Ivy 2.3.0-rc1 - 20120416000235 :: http://ant.apache.org/ivy/ ::
    [ivy:resolve] :: loading settings :: file = /home/mark/tmp/ivysettings.xml
    [ivy:resolve] :: resolving dependencies :: de.fau.fsahoy#de.fau.fsahoy.android.api15;working@mark-laptop
    [ivy:resolve]   confs: [default]
    [ivy:resolve]   found org.restlet.android#org.restlet;2.1-RC5 in restlet
    [ivy:resolve] downloading http://maven.restlet.org/org/restlet/android/org.restlet/2.1-RC5/org.restlet-2.1-RC5.jar ...
    [ivy:resolve] ..............................................................................................................................................................................................................................................................................................................................................................................................
    [ivy:resolve] ................ (699kB)
    [ivy:resolve] .. (0kB)
    [ivy:resolve]   [SUCCESSFUL ] org.restlet.android#org.restlet;2.1-RC5!org.restlet.jar (1880ms)
    [ivy:resolve] downloading http://maven.restlet.org/org/restlet/android/org.restlet/2.1-RC5/org.restlet-2.1-RC5-sources.jar ...
    [ivy:resolve] ............................................................................................................................................................................................................................................................................................................................................................................................................................................................... (738kB)
    [ivy:resolve] .. (0kB)
    [ivy:resolve]   [SUCCESSFUL ] org.restlet.android#org.restlet;2.1-RC5!org.restlet.jar(source) (971ms)
    [ivy:resolve] :: resolution report :: resolve 1713ms :: artifacts dl 2864ms
        ---------------------------------------------------------------------
        |                  |            modules            ||   artifacts   |
        |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
        ---------------------------------------------------------------------
        |      default     |   1   |   1   |   1   |   0   ||   2   |   2   |
        ---------------------------------------------------------------------