Quantcast

AntBuilder with optional scp task

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

AntBuilder with optional scp task

Pascal DeMilly (Groovy)
I am having a problem understanding how to configure AntBuilder with optional
tasks

I am trying to execute this simple task

System.setProperty('ant.home', '/home/user/.ant')
def ant = new AntBuilder ()
scp ant.scp (file:"/tmp/test", todir:'user:pass@host:/tmp', verbose:true)

But I am getting:

Problem: failed to create task or type scp
Cause: the class org.apache.tools.ant.taskdefs.optional.ssh.Scp was not found.
        This looks like one of Ant's optional components.
Action: Check that the appropriate optional JAR exists in
        -/home/guest/.ant/lib
        -/home/guest/.ant/lib
        -a directory added on the command line with the -lib argument

Do not panic, this is a common problem.
The commonest cause is a missing JAR.

This is not a bug; it is a configuration problem

Fair enough. My configuration is:

.groovy/lib:
        jsch-0.1.39.jar
.ant/lib:
        ant-jsch.jar

What else do I need?

Obviously calling groovy with "-cp ~/.ant/lib/ant-jsch.jar" works.

But why can't AntBuilder loads those jars for me.

TIA

Pasca

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: AntBuilder with optional scp task

Chris Banford
Hi Pasca,

I had the same issue as well -- you need to install the 'optional' ant
task for SCP. Here's the page:
http://ant.apache.org/manual/OptionalTasks/scp.html
and you have to add the jsch.jar:
jsch.jar 0.1.29 or later  --    sshexec and scp tasks   --  
http://www.jcraft.com/jsch/index.html

I'm using Eclipse, so added the jar to my project and all was happy :-) .

Cheers,
-Chris

> I am having a problem understanding how to configure AntBuilder with optional
> tasks
>
> I am trying to execute this simple task
>
> System.setProperty('ant.home', '/home/user/.ant')
> def ant = new AntBuilder ()
> scp ant.scp (file:"/tmp/test", todir:'user:pass@host:/tmp', verbose:true)
>
> But I am getting:
>
> Problem: failed to create task or type scp
> Cause: the class org.apache.tools.ant.taskdefs.optional.ssh.Scp was not found.
>         This looks like one of Ant's optional components.
> Action: Check that the appropriate optional JAR exists in
>         -/home/guest/.ant/lib
>         -/home/guest/.ant/lib
>         -a directory added on the command line with the -lib argument
>
> Do not panic, this is a common problem.
> The commonest cause is a missing JAR.
>
> This is not a bug; it is a configuration problem
>
> Fair enough. My configuration is:
>
> .groovy/lib:
> jsch-0.1.39.jar
> .ant/lib:
> ant-jsch.jar
>
> What else do I need?
>
> Obviously calling groovy with "-cp ~/.ant/lib/ant-jsch.jar" works.
>
> But why can't AntBuilder loads those jars for me.
>
> TIA
>
> Pasca
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>
>
>  

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

scp.jpg (141K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: AntBuilder with optional scp task

Pascal DeMilly (Groovy)

Thanks, I already tried this (see end of prior message)

My question was more related to not having to specify  those jars on the
command line but having AntBuilder acts like ant by loading all optional
tasks from home.ant System property when instantiated.

Thanks

Pascal


On Friday 13 June 2008, Chris Banford wrote:

> Hi Pasca,
>
> I had the same issue as well -- you need to install the 'optional' ant
> task for SCP. Here's the page:
> http://ant.apache.org/manual/OptionalTasks/scp.html
> and you have to add the jsch.jar:
> jsch.jar 0.1.29 or later  --    sshexec and scp tasks   --
> http://www.jcraft.com/jsch/index.html
>
> I'm using Eclipse, so added the jar to my project and all was happy :-) .
>
> Cheers,
> -Chris
>
> > I am having a problem understanding how to configure AntBuilder with
> > optional tasks
> >
> > I am trying to execute this simple task
> >
> > System.setProperty('ant.home', '/home/user/.ant')
> > def ant = new AntBuilder ()
> > scp ant.scp (file:"/tmp/test", todir:'user:pass@host:/tmp', verbose:true)
> >
> > But I am getting:
> >
> > Problem: failed to create task or type scp
> > Cause: the class org.apache.tools.ant.taskdefs.optional.ssh.Scp was not
> > found. This looks like one of Ant's optional components.
> > Action: Check that the appropriate optional JAR exists in
> >         -/home/guest/.ant/lib
> >         -/home/guest/.ant/lib
> >         -a directory added on the command line with the -lib argument
> >
> > Do not panic, this is a common problem.
> > The commonest cause is a missing JAR.
> >
> > This is not a bug; it is a configuration problem
> >
> > Fair enough. My configuration is:
> >
> > .groovy/lib:
> > jsch-0.1.39.jar
> > .ant/lib:
> > ant-jsch.jar
> >
> > What else do I need?
> >
> > Obviously calling groovy with "-cp ~/.ant/lib/ant-jsch.jar" works.
> >
> > But why can't AntBuilder loads those jars for me.
> >
> > TIA
> >
> > Pasca
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list, please visit:
> >
> >     http://xircles.codehaus.org/manage_email



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: AntBuilder with optional scp task

Chris Banford
Sorry Pascal, missed that :-)
Thanks, I already tried this (see end of prior message)

My question was more related to not having to specify  those jars on the 
command line but having AntBuilder acts like ant by loading all optional 
tasks from home.ant System property when instantiated. 

Thanks

Pascal


On Friday 13 June 2008, Chris Banford wrote:
  
Hi Pasca,

I had the same issue as well -- you need to install the 'optional' ant
task for SCP. Here's the page:
http://ant.apache.org/manual/OptionalTasks/scp.html
and you have to add the jsch.jar:
jsch.jar 0.1.29 or later  --    sshexec and scp tasks   --
http://www.jcraft.com/jsch/index.html

I'm using Eclipse, so added the jar to my project and all was happy :-) .

Cheers,
-Chris

    
I am having a problem understanding how to configure AntBuilder with
optional tasks

I am trying to execute this simple task

System.setProperty('ant.home', '/home/user/.ant')
def ant = new AntBuilder ()
scp ant.scp (file:"/tmp/test", todir:'user:pass@host:/tmp', verbose:true)

But I am getting:

Problem: failed to create task or type scp
Cause: the class org.apache.tools.ant.taskdefs.optional.ssh.Scp was not
found. This looks like one of Ant's optional components.
Action: Check that the appropriate optional JAR exists in
        -/home/guest/.ant/lib
        -/home/guest/.ant/lib
        -a directory added on the command line with the -lib argument

Do not panic, this is a common problem.
The commonest cause is a missing JAR.

This is not a bug; it is a configuration problem

Fair enough. My configuration is:

.groovy/lib:
	jsch-0.1.39.jar
.ant/lib:
	ant-jsch.jar

What else do I need?

Obviously calling groovy with "-cp ~/.ant/lib/ant-jsch.jar" works.

But why can't AntBuilder loads those jars for me.

TIA

Pasca

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
      



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




  

Loading...