IVY:无法解决restlet依赖关系

时间:2012-07-07 20:16:46

标签: ivy restlet dependency-management

我有一个java项目设置,并希望使用常春藤作为依赖管理工具。但是,我无法让最简单的工作。

这是我的代码:

的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>

我得到的错误是:

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

您可以在maven.restlet.org

查看存储库结构

遗憾的是,这些错误消息并不是最好的。我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

我无法重现您的错误....

  • 您使用的是哪种版本的常春藤?
  • 你是如何调用常春藤任务的?

测试

的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>

构建输出

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   |
    ---------------------------------------------------------------------