0

我将 IvyDE 与 Eclipse Indigo 一起使用。我有一个看起来像这样的 ivy.xml 文件:

<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
    <info organisation="com.restphone" module="javasignatureparser_2.10" revision="0.3-SNAPSHOT" status="integration" publication="20121208180225">
        <description>
        JavaSignatureParser
        </description>
    </info>
    <configurations>
        <conf name="compile" visibility="public" description=""/>
        <conf name="runtime" visibility="public" description="" extends="compile"/>
        <conf name="test" visibility="public" description="" extends="runtime"/>
        <conf name="provided" visibility="public" description=""/>
        <conf name="optional" visibility="public" description=""/>
        <conf name="sources" visibility="public" description=""/>
        <conf name="docs" visibility="public" description=""/>
        <conf name="pom" visibility="public" description=""/>
    </configurations>
    <dependencies defaultconfmapping="*->default,sources" >
        <dependency org="org.scalaz" name="scalaz-core_2.10.0-RC3" rev="7.0.0-M5" conf="compile->default(compile);sources->default(compile)"/>
    </dependencies>
</ivy-module>

IvyIDE 容器具有 scala-library 的源附件(传递依赖项,未在 ivy.xml 代码中列出),但没有 scalaz-core 的源附件。

如果我查看本地常春藤缓存(容器有文件的地方),我会看到:

C:\Users\james\.ivy2\cache\org.scalaz\scalaz-core_2.10.0-RC3
  bundles
    scalaz-core_2.10.0-RC3-7.0.0-M5.jar
  sources
    scalaz-core_2.10.0-RC3-7.0.0-M5-sources.jar

知道为什么 IvyIDE 无法弄​​清楚如何使用 scalaz-core_2.10.0-RC3-7.0.0-M5-sources.jar 吗?

/cygdrive/C/Users/james/.ivy2/cache/org.scalaz/scalaz-core_2.10.0-RC3/ivy-7.0.0-M5.xml 中有一个常春藤配置文件,它说工件的类型是“捆绑” - 这是相关的吗?

<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
        <info organisation="org.scalaz"
                module="scalaz-core_2.10.0-RC3"
                revision="7.0.0-M5"
                status="release"
                publication="20121123051347"
        >
                <license name="BSD-style" url="http://www.opensource.org/licenses/bsd-license.php" />
                <description homepage="http://scalaz.org">
                scalaz-core
                </description>
        </info>
        <configurations>
                <conf name="default" visibility="public" description="runtime dependencies and master artifact can be used with this conf" extends="runtime,master"/>
                <conf name="master" visibility="public" description="contains only the artifact published by this module itself, with no transitive dependencies"/>
                <conf name="compile" visibility="public" description="this is the default scope, used if none is specified. Compile dependencies are available in all classpaths."/>
                <conf name="provided" visibility="public" description="this is much like compile, but indicates you expect the JDK or a container to provide it. It is only available on the compilation classpath, and is not transitive."/>
                <conf name="runtime" visibility="public" description="this scope indicates that the dependency is not required for compilation, but is for execution. It is in the runtime and test classpaths, but not the compile classpath." extends="compile"/>
                <conf name="test" visibility="private" description="this scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases." extends="runtime"/>
                <conf name="system" visibility="public" description="this scope is similar to provided except that you have to provide the JAR which contains it explicitly. The artifact is always available and is not looked up in a repository."/>
                <conf name="sources" visibility="public" description="this configuration contains the source artifact of this module, if any."/>
                <conf name="javadoc" visibility="public" description="this configuration contains the javadoc artifact of this module, if any."/>
                <conf name="optional" visibility="public" description="contains all optional dependencies"/>
        </configurations>
        <publications>
                <artifact name="scalaz-core_2.10.0-RC3" type="bundle" ext="jar" conf="master"/>
        </publications>
        <dependencies>
                <dependency org="org.scala-lang" name="scala-library" rev="2.10.0-RC3" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
        </dependencies>
</ivy-module>

更新:事情变得有点陌生。如果我删除该 scalaz-core_2.10.0-RC3/ivy-7.0.0-M5.xml 文件,然后更改 ivy.xml 中的一行,该文件将再次下载 - 它不一样。有时,我会在文件中获得更多行!像这样:

<publications>
        <artifact name="scalaz-core_2.10.0-RC3" type="bundle" ext="jar" conf="master"/>
        <artifact name="scalaz-core_2.10.0-RC3" type="source" ext="jar" conf="sources" m:classifier="sources"/>
        <artifact name="scalaz-core_2.10.0-RC3" type="javadoc" ext="jar" conf="javadoc" m:classifier="javadoc"/>
</publications>
4

1 回答 1

1

类型是相关的,IvyDE 使用“源类型”确定源是否存在。

在“源类型”中,在 IvyDE 托管库中的选项卡 Source/Javadoc 中。默认值为“源”。

您在已解析工件的 ivy.xml 中显示的内容表明该类型是捆绑包,不会被视为源工件。

但是,我尝试使用一个非常默认的配置来解决自己的问题(我刚刚将 Eclipse 和 IvyDE 安装到一个空项目中),以及为 scalaz-core 解析的 ivy 文件:

<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
<info organisation="org.scalaz"
    module="scalaz-core_2.10.0-RC3"
    revision="7.0.0-M5"
    status="release"
    publication="20121123141347"
>
    <license name="BSD-style" url="http://www.opensource.org/licenses/bsd-license.php" />
    <description homepage="http://scalaz.org">
    scalaz-core
    </description>
</info>
<publications>
    <artifact name="scalaz-core_2.10.0-RC3" type="bundle" ext="jar" conf="master"/>
    <artifact name="scalaz-core_2.10.0-RC3" type="source" ext="jar" conf="sources" m:classifier="sources"/>
    <artifact name="scalaz-core_2.10.0-RC3" type="javadoc" ext="jar" conf="javadoc" m:classifier="javadoc"/>
</publications>
<dependencies>
    <dependency org="org.scala-lang" name="scala-library" rev="2.10.0-RC3" force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
</dependencies>

为了清楚起见,我删除了配置部分。

你确定你是从 maven2 存储库下载的:

http://repo1.maven.org/maven2/

也许他们在过去 10 小时内改变了它。

如果我是你,我会尝试将 bundle 添加到“源类型”中。不过不确定后果。

于 2012-12-09T14:14:53.637 回答