问题
I can do SCP task while i add jsch-0.1.44.jar to ant/lib directory.But i want to load from the local lib dir and add it to classpath.Could you please help
回答1:
The built-in tasks have limited options for customizing the classpath.
1) Place your custom jars in the ${user.home}/.ant/lib directory
/home/mark/.ant
└── lib
├── ivy.jar
└── jsch.jar
This is where I install jars that are my personal extensions to the standard ANT distro
2) Supply the location of the jar directory on the commandline
ant -lib /path/to/jsh/jar
3) You could try to declare a new task as recommended here:
- specifying classpath for built-in ant tasks
来源:https://stackoverflow.com/questions/13468153/loading-jsch-library-from-local-lib-directory-in-ant-build-xml