ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asgeir <vil...@gmail.com>
Subject specifying location of an external library within build.xml
Date Fri, 03 Nov 2006 23:45:44 GMT
Hello All,

Is there a way to specify the location of an external library for an
optional task (jsch.jar in my case) from within build.xml, or to change the
order of classes being loaded?

Here's what I'm trying to do:
build.xml contains <scp> and <sshexec> tasks, so I provide jsch.jar and
other libraries in the same directory together with build.xml.
the following works fine with Ant 1.5: build.xml checks for current ant
version and if it is 1.5 it does <taskdef name="scp"> with custom classpath
containing ant-jsch.jar (from 1.6), jsch.jar, etc.

Class org.apache.tools.ant.taskdefs.optional.ssh.Scp loaded from ant loader
Finding class com.jcraft.jsch.UserInfo
Class com.jcraft.jsch.UserInfo loaded from ant loader

However, the same build fails with Ant 1.6, with or without <taskdef>:

Class org.apache.tools.ant.taskdefs.optional.ssh.Scp loaded from parent
loader (parentFirst)
A class needed by class
org.apache.tools.ant.taskdefs.optional.ssh.Scpcannot be found:
com/jcraft/jsch/UserInfo

I cannot modify the standard Ant installation (e.g. put jsch.jar in ant lib
directory, or remove ant-jsch.jar), or add command-line flags, or modify
system environment variables, etc.: the script has to run with default Ant
on different systems. Unfortunately, currently it only runs with Ant 1.5 and
not 1.6.

Thanks in advance!

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message