Eclipse Ivy插件说jruby有一个未解决的依赖,但jruby 1.6.6没有任何依赖

时间:2012-02-21 02:19:09

标签: eclipse ivy

当我尝试使用ivy Eclipse插件添加jruby作为依赖项时,我收到此错误:

Impossible to resolve dependencies of com.restphone#;working@James-Moores-iMac.local
unresolved dependency: org.jruby.extras#bytelist;1.0.8: not found

这是在我的ivy.xml中:

 <dependency org="org.jruby" 
  name="jruby-complete" 
  rev="1.6.6" />

这是在ivysettings.xml:

<ivysettings>
    <settings defaultResolver="chain"/>
    <resolvers>
        <chain name="chain">
            <ibiblio name="codehaus" m2compatible="true" root="http://repository.codehaus.org/"/>
        </chain>
    </resolvers>
</ivysettings>

但根据jruby邮件列表,jruby has NO dependencies for runtime, compile or test scope

我是否需要在某处向常春藤插件提供更多信息?

2 个答案:

答案 0 :(得分:1)

虽然JRuby文档可能没有说明所需的依赖项,但看起来好像您正在使用的存储库...

你已经要求'jruby-complete'了,如果你去看看这个POM,你会看到它指定了jruby extras。

一个选项是选择一个不同的POM文件作为依赖关系的基础,但快速解决方法是将属性transitive =“false”添加到您的依赖项中。

<dependency org="org.jruby" 
  name="jruby-complete" 
  transitive="false"
  rev="1.6.6" />

答案 1 :(得分:1)

在我看来,为依赖项指定配置映射总是一个好主意。

以下常春藤文件对我来说很好。如上所述,只下载了红宝石罐。

<ivy-module version="2.0">
    <info organisation="org.demo" module="demo"/>
    <configurations>
        <conf name="compile"/>
        <conf name="runtime" extends="compile"/>
        <conf name="test"    extends="runtime"/>
    </configurations>
    <dependencies>
         <dependency org="org.jruby" name="jruby-complete" rev="1.6.6" conf="compile->default"/>
    </dependencies>
</ivy-module>

这里我将本地“编译”配置映射到默认的远程配置。 (在Maven模块中,默认的常春藤配置转换为“编译”范围)。


我挖掘了remote POM file

  <properties>
    <jar.scope>provided</jar.scope>
    ..
    ..

    <dependency>
      <groupId>org.jruby.joni</groupId>
      <artifactId>joni</artifactId>
      <scope>${jar.scope}</scope>
    </dependency>
    <dependency>
      <groupId>org.jruby.extras</groupId>
      <artifactId>jnr-netdb</artifactId>
      <scope>${jar.scope}</scope>
    </dependency>
    ...

所有额外的依赖都已在“提供的”Maven范围内声明。

几个问题:

1) 在Maven中,提供的范围用于编译 模块所需的jar。它们不需要打包,因为它们是目标运行时环境的一部分。类似地,这种依赖性不需要作为模块的传递依赖,因此不需要下载。

2) 所有的罐子都位于Maven Central仓库。如果您选择省略常春藤配置映射

,则以下设置文件将检索所有内容
<ivysettings>
    <property name="ivy.checksums" value=""/>
    <settings defaultResolver="chain"/>
    <resolvers>
        <chain name="chain">
            <ibiblio name="central" m2compatible="true"/>
        </chain>
    </resolvers>
</ivysettings>

3) 以下错误是由垃圾校验和引起的。我提供的设置文件禁用了此检查...建议您不要在远程存储库中执行此操作

[ivy:resolve] :::: WARNINGS
[ivy:resolve]   problem while downloading module descriptor: http://repo1.maven.org/maven2/org/jruby/extras/bytelist/1.0.8/bytelist-1.0.8.pom: invalid sha1: expected=e40ee094403473e43f71e21cf9cbf71f08d2098b computed=a9627bc7e42f886e290985367040794adb676320 (977ms)
[ivy:resolve]       module not found: org.jruby.extras#bytelist;1.0.8