Search code examples
ivydependency-managementartifactoryivyde

Why can't Ivy resolve my configurations


I've got an Ivy and Artifactory setup to publish and depend on builds with.

In Artifactory I have an Ivy file along the lines of:

<?xml version="1.0" encoding="UTF-8"?>
<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="org" module="module" branch="HEAD" revision="0.277-SNAPSHOT" status="integration" publication="20140724114055">
</info>

<configurations>
    <conf name="compile" visibility="public" description="Default required to compile the full module"/>
    <conf name="build" visibility="public" extends="compile" description="Incorporates additional build tools onto the classpath"/>
</configurations>

<publications defaultconf="compile">
    <artifact name="module" type="jar" ext="jar"/>
    <artifact name="module-src" type="source" ext="zip"/>
    <artifact name="module-doc" type="doc" ext="zip"/>
</publications>

<dependencies>
    <dependency org="junit" name="junit" rev="4.8.1" conf="compile->*"/>
    <dependency org="net.sf.proguard" name="proguard" rev="4.11" conf="build">
        <artifact name="proguard" ext="jar"/>
    </dependency>
</dependencies>
</ivy-module>

When I come to depend on this module in another project I specify the compile configuration but get told by IvyDE that compile does not exist.

<?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="org"
    module="module2"
    status="integration">
</info>

<configurations>
    <conf name="compile" description="Default required to compile the full module" />
</configurations>

<dependencies>
    <dependency transitive="true" org="org" name="module" rev="latest.integration" conf="compile">
        <artifact name="module" type="jar" ext="jar" />
        <artifact name="module-src" type="source" ext="zip" />
        <artifact name="module-doc" type="doc" ext="zip" />
    </dependency>
</dependencies>
</ivy-module>

With this setup I get the error message

"configuration not found in org#module;0.277-SNAPSHOT: 'compile'"

I do get the jar if the dependency conf is updated to compile->* but I don't get the source or javadoc downloaded unless they are explicitly defined as dependencies. I am also expecting that junit will appear on the build path as it is defined as a compile dependency but there is no sign of that appearing while it doesn't know what the compile configuration is I guess.

Any suggestions please!


Solution

  • It seems the reason for this was Ivy not finding the ivy in artifactory correctly. Using a URL resolver rather than a ibiblio resolver and defining the ivy pattern everything is working correctly.