This looks like the bug which just got reported yesterday https://issues.apache.org/jira/browse/IVY-1580. I can reproduce this locally too, so it's a genuine bug. I'll take a look over the weekend.

-Jaikiran


On 25/05/18 11:36 AM, Justin Vallon wrote:
Goal: Try to build a simple X.java with dependency on org.jmock/jmock
and org.jmock/jmock-junit4.

Trouble with ivy 2.5.0-rc1, but ok with 2.4.0:

ivy.xml:
<?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="qq" module="zz" />
   <dependencies>
     <!-- https://mvnrepository.com/artifact/org.jmock/jmock -->
     <dependency org="org.jmock" name="jmock" rev="2.8.4" />
     <dependency org="org.jmock" name="jmock-junit4" rev="2.8.4" />
   </dependencies>
</ivy-module>

build.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="qq" default="default">
   <target name="default">
     <delete dir="obj" />
     <mkdir dir="obj" />
     <mkdir dir="obj/classes" />
    <property name="ivy.default.ivy.user.dir" location="obj/user-dir" />

     <ivy:retrieve pathid="compile.classpath" />

     <pathconvert property="clspth" pathsep="${line.separator}">
       <path refid="compile.classpath" />
       <globmapper from="${ivy.lib.dir}/*" to="LIB/*" />
     </pathconvert>
     <echo
message="classpath:${line.separator}${clspth}${line.separator}${line.separator}"
/>
    <javac destdir="obj/classes" includeantruntime="false" >
       <src path="src" />
       <classpath refid="compile.classpath" />
     </javac>
   </target>

</project>

src/X.java:

import org.jmock.Expectations;
import org.jmock.integration.junit4.JUnitRuleMockery;

class X {
}

With ivy 2.4.0, this works.  With 2.5.0-rc1, the compile fails with
missing package org.jmock for "org.jmock.Expectations".

Difference between classpaths:

2.4.0     LIB/jmock-2.8.4-sources.jar
2.4.0     LIB/jmock-2.8.4.jar
2.4.0     LIB/jmock-2.8.4-javadoc.jar
2.5.0-rc1 LIB/jmock-2.8.4-tests.jar

org.jmock.Expectations is in jmock-2.8.4.jar.

Comparing cache/org.jmock/jmock-junit4/ivy-2.8.4.xml:

Old conf "test" private
New conf "test" public (many of the ivy.xmls have this change)

Old dependencies of org="org.jmock" name="jmock":

                <dependency org="org.jmock" name="jmock" rev="2.8.4"
force="true" conf="compile->compile(*),master(*);runtime->runtime(*)"/>
                <dependency org="org.jmock" name="jmock" rev="2.8.4"
force="true" conf="test->runtime(*),master(*)">
                        <artifact name="jmock" type="test-jar" ext="jar"
conf="" m:classifier="tests"/>
                </dependency>

New dependencies of org="org.jmock" name="jmock":

                <dependency org="org.jmock" name="jmock" rev="2.8.4"
force="true"
conf="compile->compile(*),master(*);runtime->runtime(*);test->runtime(*),master(*)">
                        <artifact name="jmock" type="test-jar" ext="jar"
conf="" m:classifier="tests"/>
                </dependency>

Both of the ivy-2.8.4.xml.original files say:

         <dependency>
             <groupId>org.jmock</groupId>
             <artifactId>jmock</artifactId>
             <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>

         <dependency>
             <groupId>org.jmock</groupId>
             <artifactId>jmock</artifactId>
             <version>${project.version}</version>
             <type>test-jar</type>
             <scope>test</scope>
         </dependency>

Any ideas on what the trouble is here?


Reply via email to