I've solved the problem by grabbing the ant sources, and moving the ssh 
tasks under:

src\main\org\apache\tools\ant\taskdefs\optional\ssh\external

this was more hackish, but easier than moving it to 
external.org.apache.tools.ant.taskdefs... where i think it really belongs. 
this created an ant-jsch.jar under a different package structure than the 
one in the ant lib folder. i also went the route of using the following 
properties to create the tasks. 

escp=org.apache.tools.ant.taskdefs.optional.ssh.external.Scp
esshexec=org.apache.tools.ant.taskdefs.optional.ssh.external.SSHExec

i think possibly a better solution would be for ant to provide all the 
optional tasks in their current form (backward compatability i suppose) and 
to also provide them under a package structure of 
external.org.apache.tools.ant.taskdefs.optional.*. The items under the new 
package structure wouldn't be in the ant lib folder at all and wouldn't be 
used unless the end user puts them into the classpath and issues the 
taskdef. The naming of the tasks can be resolved by namespaces it seems. 
such that one could use <external:sshexec in their build script. 

i guess this is more an issue to take with the ant-dev folks, but if any 
users desire to use the optional tasks (ftp, ssh, junit, etc) without 
touching the external environment in any way, this is one solution you can 
try.

On 8/16/05, Mark Lybarger <[EMAIL PROTECTED]> wrote:
> 
> Ok, I think i've worked out the namespace issues and have read a bit on 
> ant namespaces for tasksdef's. It seems that namespaces/uri is used with 
> taskdefs so that scp, and my:scp will allow the definition of both the 
> ant-lib supplied:
> 
> scp=org.apache.tools.ant.taskdefs.optional.ssh.Scp
> 
> and perhaps my own:
> 
> scp=external.org.apache.tools.ant.taskdefs.optional.ssh.Scp
> 
> this allows my code to use <my:scp > to refer to the second item, and 
> still allows scp to refer to the first one. this merely seems related to the 
> name the task will take in the ant script itself. it doesn't seem to have to 
> do with the fact that org.apache.tools.ant.taskdefs.optional.ssh.Scp is 
> defined in the ant-lib folder, and as such, a user can't use the scp task 
> without modifications outside of their environment (as mentioned earlier, a 
> user can use ~/.ant/lib, adding jsch.jar to ant-lib, or -antlib parameter, 
> or remove the ant-jscp.jar from ant lib).
> 
> what i'd like is to be able to use the scp task without modifying the 
> installed ant, or modifying anything outside of the build environment. 
> 
> BUILD FAILED
> D:\dev\workspace\autodeploy\build.xml:570: taskdef A class needed by class 
> org.apache.tools.ant.taskdefs.optional.ssh.SSHExec cannot be found: 
> com/jcraft/jsch/UserInfo
> 
> 
> On 8/16/05, Mark Lybarger <[EMAIL PROTECTED]> wrote:
> > 
> > i have both jsch.jar and ant-jsch.jar in mylibfolder, but i don't see 
> > that i've tied the xmlns:my etc to my ant-jsch.xml 
> > 
> > perhaps i need a taskdev using the my: namespace so that it can see the 
> > xml and .properties files. i'm not quite sure how this would look.
> > 
> > 
> > On 8/16/05, [EMAIL PROTECTED] <[EMAIL PROTECTED] > 
> > wrote:
> > > 
> > > sure - see 
> > > http://ant.apache.org/manual/install.html#librarydependencies
> > > 
> > > Jan
> > > 
> > > >-----Ursprüngliche Nachricht-----
> > > >Von: Mark Lybarger [mailto: [EMAIL PROTECTED]
> > > >Gesendet: Dienstag, 16. August 2005 16:28
> > > >An: Ant Users List
> > > >Betreff: Re: optional tasks without disturbing the ant/lib folder
> > > >
> > > >very interesting!
> > > >
> > > >i created an antlib.xml file in mylibdir/antlib.xml 
> > > >
> > > ><antlib>
> > > ><!-- typedef the tasks that work for ant less than 1.6 -->
> > > ><taskdef resource="ant-jsch.properties"/>
> > > >
> > > ><!-- condition typedefs - these do not work for ant less than 
> > > >1.6 --> </antlib>
> > > >
> > > >also mylibdir/ant-jsch.properties
> > > >
> > > >scp=org.apache.tools.ant.taskdefs.optional.ssh.Scp
> > > >sshexec=org.apache.tools.ant.taskdefs.optional.ssh.SSHExec
> > > > 
> > > >and build.xml:
> > > >
> > > ><project name="myproject" xmlns:my="antlib:mylibdir/antlib.xml" > ...
> > > ><my:scp ...
> > > >
> > > >which outputs:
> > > >
> > > >D:\dev\workspace\autodeploy\build.xml:582: Could not create 
> > > >task or type of
> > > >type: antlib:mylibdir/antlib.xml:scp.
> > > >
> > > >am i missing something obvious?
> > > >
> > > >
> > > >On 8/16/05, [EMAIL PROTECTED] 
> > > ><[EMAIL PROTECTED]> wrote:
> > > >>
> > > >> >what would be really nice is if there were two "namespaces" 
> > > >> >available for a given optional task. such that the task in the 
> > > >> >ant/lib/ant-jsch.jar would
> > > >> >have:
> > > >> >
> > > >> ><taskdef name="scp" classname="
> > > >> >org.apache.tools.ant.taskdefs.optional.ssh.Scp"> 
> > > >> >
> > > >> >and perhaps an ant/external/lib/ant-jsch.jar would have:
> > > >> >
> > > >> ><taskdef name="e_scp" classname="
> > > >> >external.org.apache.tools.ant.taskdefs.optional.ssh.Scp ">
> > > >> >
> > > >> >thoughts/ideas?
> > > >>
> > > >> XML namespaces.
> > > >>
> > > >> <scp> is defined in
> > > >>
> > > >[$ANT_HOME/lib/ant.jar!]org/apache/tools/ant/taskdefs/default.properti 
> > > 
> > > >> es
> > > >>
> > > >> Define your scp via an antlib.xml and load it <project
> > > >> xmlns:my="antlib:path/to/my/jar"> And use it with <my:scp>
> > > >>
> > > >>
> > > >> Jan 
> > > >>
> > > >> 
> > > ---------------------------------------------------------------------
> > > >> To unsubscribe, e-mail: [EMAIL PROTECTED] For
> > > >additional
> > > >> commands, e-mail: [EMAIL PROTECTED]
> > > >>
> > > >>
> > > >
> > > 
> > > --------------------------------------------------------------------- 
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > 
> > > 
> > 
>

Reply via email to