Hi all,
in our setup, we use an sftp resolver to publish to our company
repository. That resolver need an additional jar (jsch.jar) on the ivy
class path to work.
This works fine with the following Ant snippet:
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant">
<classpath >
<fileset dir="${generic.buildsys.dir}/lib-ivy">
<include name="jsch*.jar" />
<include name="ivy*.jar" />
</fileset>
</classpath>
</taskdef>
But when I install the the IvyDE feature, it seems to add the ivy jar to
ant's class path.
In our case, this leads to a situation, where the classpath of the above
<taskdef> seems to be ignored and the jsch.jar is not found. Any
subsequent <ivy:resolve> task will fail due to a ClassNotFoundException
when Ant is invoked from within Eclipse. My guess is, that this is
caused by Ant's class loader implementation as described here:
<http://ant.apache.org/faq.html#delegating-classloader>.
Adding an appropriate <classpath> in the ivysettings file does not seem
to have any effect.
Here's the ouptut from 'Ant -v' invoked from within Eclipse:
Without IvyDE:
-init-ivy:
fileset: Setup scanner in dir
U:\develop\TRM-3.x-src\Buildtools\generic-buildsys\lib-ivy with
patternSet{ includes: [jsch*.jar, ivy*.jar] excludes: [] }
parsing buildfile
jar:file:/U:/develop/TRM-3.x-src/Buildtools/generic-buildsys/lib-ivy/ivy-2.0.0.jar!/org/apache/ivy/ant/antlib.xml
with URI =
jar:file:/U:/develop/TRM-3.x-src/Buildtools/generic-buildsys/lib-ivy/ivy-2.0.0.jar!/org/apache/ivy/ant/antlib.xml
Finding class org.apache.ivy.ant.IvyAntSettings
Loaded from
U:\develop\TRM-3.x-src\Buildtools\generic-buildsys\lib-ivy\ivy-2.0.0.jar
org/apache/ivy/ant/IvyAntSettings.class
With IvyDE 2.1.0 installed:
-init-ivy:
fileset: Setup scanner in dir
U:\develop\TRM-3.x-src\Buildtools\generic-buildsys\lib-ivy with
patternSet{ includes: [jsch*.jar, ivy*.jar] excludes: [] }
parsing buildfile
jar:file:/D:/mehr%20Programme/eclipse/plugins/org.apache.ivy.eclipse.ant_2.2.0.final_20100923230623/ivy.jar!/org/apache/ivy/ant/antlib.xml
with URI =
jar:file:/D:/mehr%20Programme/eclipse/plugins/org.apache.ivy.eclipse.ant_2.2.0.final_20100923230623/ivy.jar!/org/apache/ivy/ant/antlib.xml
Class org.apache.ivy.ant.IvyAntSettings loaded from parent loader
(parentFirst)
+Datatype ivy:/razorcat.com:settings org.apache.ivy.ant.IvyAntSettings
...
[ivy:resolve] setting 'ivy.cache.resolution' to
'C:\Users\m.weber\.ivy2/cache-resolv'
[ivy:resolve] setting 'ivy.cache.repository' to
'C:\Users\m.weber\.ivy2/cache-repo'
BUILD FAILED
U:\develop\TRM-3.x-src\Buildtools\generic-buildsys\build-impl.xml:117:
java.lang.NoClassDefFoundError: com/jcraft/jsch/JSchException
It would be useful, if at least the Ivy preferences in Eclipse would
allow to disable the ivy.jar on Ant's class path, since this breaks
Ivy's plugin loading mechanism.
Regards,
Martin Weber