我正在使用Eclipse Indigo的IvyDE。我有一个看起来像这样的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中有一个常春藤配置文件,其中说明了artifact是一个“捆绑” - 是相关的吗?
<?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>
答案 0 :(得分:1)
类型是相关的,IvyDE使用'sources type'确定源是否存在。
在'sources types'中,在IvyDE托管库的Source / Javadoc选项卡中。默认值为'source'。
您在已解析工件的ivy.xml中显示的内容,它表明该类型是不会被视为源工件的bundle。
但是,我尝试使用一个非常默认的配置(我只是将Eclipse和IvyDE安装到一个空项目)和解析的scalaz-core常春藤文件来解决自己:
<?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小时内改变了它。
如果我是你,我会尝试将包添加到'源类型'。虽然不确定分枝。