0
votes

I'm using IvyDE with Eclipse Indigo. I've got an ivy.xml file that looks like this:

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

The IvyIDE container has a source attachment for scala-library (a transitive dependency, not listed in the ivy.xml code), but no source attachment for scalaz-core.

If I look in the local ivy cache (where the container has the files), I see:

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

Any idea why IvyIDE can't figure out how to use scalaz-core_2.10.0-RC3-7.0.0-M5-sources.jar?

There's an ivy configuration file in /cygdrive/C/Users/james/.ivy2/cache/org.scalaz/scalaz-core_2.10.0-RC3/ivy-7.0.0-M5.xml that says the type of the artifact is a "bundle" - is that related?

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

Update: things just got a little stranger. If I remove that scalaz-core_2.10.0-RC3/ivy-7.0.0-M5.xml file, then change a line in ivy.xml, that file gets downloaded again - AND ITS NOT THE SAME. Sometimes, I get more lines in the file! Like this:

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

1 Answers

1
votes

Type is related, the IvyDE determines if the sources exist using the 'sources type'.

In the 'sources types', in the tab Source/Javadoc in the IvyDE managed library. The default ones are 'source'.

What you show in the ivy.xml of the resolved artifacts, it shows that the type is bundle which will not be considered a source artifacts.

However, I tried to resolve myself with a very default configuration (I just installed Eclipse and IvyDE to an empty project), and the resolved ivy file for 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>

I removed the configuration section for clarity.

Are you sure you are downloading from the maven2 repository:

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

Maybe they changed it in the last 10 hours.

I would try adding bundle to the 'source types' if I were you. Not sure about the ramification though.