On Fri, 1 Apr 2005, GOKULAM Jayaram wrote:

Jayaram,

I finally got it to work using maven 1.0.2 / ant 1.5.3-1!

It requires a bit of hacking.

First, edit maven.xml, and just before your <ant:ftp/> tag
add this one:

        <taskdef
                name="ftp"
                classname="org.apache.tools.ant.taskdefs.optional.net.FTP"
        />

The taskdef is required for maven to even recognize the ftp ant task.
If you don't supply it, nothing happens (I don't know why..).

This task is defined in ant-optional-${version}.jar,
which is loaded in the root classloader.

When you run maven -X now, you get the following nested exception:

java.lang.NoClassDefFoundError: com/oroinc/net/ftp/FTP

The ant documentation states that the NetComponents.jar is needed
for the FTP task. The trouble is getting maven to see it.
You cannot just simply depend on it, since the taskdef
is run in the root classloader (where ant resides), and it won't
see any dependency (at least, that is my finding..)

So, next we have to make sure maven loads the NetComponents.jar
in it's root classloader.

First, get NetComponents.jar from this archive:
http://www.savarese.org/oro/downloads/NetComponents-1.3.8.tar.gz

and copy it to ${maven.home}/lib.

This will cause it to get loaded in the [root.maven] classloader,
but still doesn't work.

Then, edit ${maven.home}/bin/forehead.conf,
and add this line

        ${maven.home}/lib/NetComponents.jar

below this one:

        ${maven.home}/lib/log4j-1.2.8.jar

which makes sure that the class is available in the root classloader,
and thus available to ant.

Somehow I think this is documented somewhere... at least, it should be ;)

So, let me know if this solves your problem!

Greetings,

        Kenney Westerhof

> Kenney,
> I want to upgrade my ant from 1.5 to 1.6, not the maven snapshot.
> Can u please let me know what I should do ?
>
> Thanks,
> Jayaram
>
>
>
> -----Original Message-----
> From: Kenney Westerhof [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 01, 2005 4:38 PM
> To: Maven Users List
> Subject: RE: ANT FTP with Maven
>
> On Fri, 1 Apr 2005, GOKULAM Jayaram wrote:
>
> That won't work. If you want to use maven 1.1-SNAPSHOT, you'll
> need to build it from source. (I couldn't find a binary distribution,
> but maybe you can).
>
> See http://maven.apache.org/developers/building-from-source.html.
>
> But I find it rather unstable at the moment...
>
> Greetings,
>
>       Kenney
>
> > That's fine Kenney,
> > Do I just need to add a dependency to upgrade or do I need to do some thing 
> > else?
> >
> > I added the following in my project.xml
> >       <dependency>
> >               <groupId>ant</groupId>
> >               <artifactId>ant</artifactId>
> >               <version>1.6</version>
> >               <jar>ant-1.6.jar</jar>
> >     </dependency>
> >
> > Still did not get it working
> >
> > May I know how you got that worked please?
> >
> > Thanks,
> > Jayaram
> >
> > -----Original Message-----
> > From: Kenney Westerhof [mailto:[EMAIL PROTECTED]
> > Sent: Friday, April 01, 2005 3:26 PM
> > To: Maven Users List
> > Subject: RE: ANT FTP with Maven
> >
> > On Fri, 1 Apr 2005, GOKULAM Jayaram wrote:
> >
> > Well, I got curious and tried it out myself. It doesn't work. ;)
> > Btw, your XML was invalid:
> >
> >     <ant:ftp
> >     ...
> >     />
> >     </ant:ftp>
> >
> > Using ant 1.5.1, 1.5.1, including commons, I can't get it to work. Even
> > the site:ftpdeploy didn't work.
> >
> > Using ant 1.6.2 I got it to work. So you might consider upgrading to maven
> > 1.1-SNAPSHOT. Or use the ssh method.
> >
> > Anyway, ant 1.5 is over 2 years old, so it's about time to start using
> > 1.6.2 anyway :)
> >
> > If anyone else got ftp to work using maven 1.0.2, I'd like to see how :)
> >
> > Greetings,
> >
> >     Kenney
> >
> >
> > > Yes Kenney,
> > >
> > > I have the definition of ant,
> > > This is how my plugin.jelly starts with.
> > > <project
> > >    xmlns:j="jelly:core"
> > >    xmlns:util="jelly:util"
> > >    xmlns:ant="jelly:ant"
> > >    xmlns:x="jelly:xml">
> > >
> > > Yes you are right I had a trial the second time after changing the 
> > > directory, and have wrongly pasted it.
> > >
> > > Otherwise the problem is the same.
> > > Can u please let me know what should be the problem.
> > >
> > > Thanks,
> > > Jayaram
> > >
> > >
> > > -----Original Message-----
> > > From: Kenney Westerhof [mailto:[EMAIL PROTECTED]
> > > Sent: Friday, April 01, 2005 2:53 PM
> > > To: Maven Users List
> > > Subject: RE: ANT FTP with Maven
> > >
> > > On Fri, 1 Apr 2005, GOKULAM Jayaram wrote:
> > >
> > > Well.. the obvious thing could be that you did not declare the ant
> > > namespace prefix. Do you have  xmlns:ant="jelly:ant" defined?
> > >
> > > Further, the lines printed do not match the lines in your jelly script.
> > > The remotedir is not the same. Either you changed it before copying
> > > to this mail or those lines are from another script...
> > >
> > > >
> > > >
> > > > Hi dudes,
> > > >
> > > > I have a doubt, why does maven print my ftp code on the console window?
> > > >
> > > > The following lines are displayed on my console
> > > > <ftp password="password" action="mkdir" userid="user1" 
> > > > server="ftp.com.org" remotedir="/home/mcone/TEST"></ftp>
> > > >
> > > >
> > > > My original code in the plugin.jelly is as below,
> > > >   <ant:ftp action="mkdir" server="${maven.remote.machine}"              
> > > > userid="${maven.remote.user}"
> > > >                 password="${maven.remote.password}"
> > > >                remotedir="/tmp/TEST"
> > > >  />
> > > > </ant:ftp>
> > > >
> > > > I believe maven did not understand my script, is it so? Can you please 
> > > > help me what should be the problem?
> > > >
> > > > Kenney,
> > > > I also googled on loading ant's ftp task, am able to find the same what 
> > > > I have done. Am I missing something? If so can u please point me 
> > > > towards a link.
> > > >
> > > > Thanks,
> > > > Jayaram
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: Arnaud HERITIER [mailto:[EMAIL PROTECTED]
> > > > Sent: Friday, April 01, 2005 1:24 AM
> > > > To: 'Maven Users List'; 'dan tran'
> > > > Subject: RE: ANT FTP with Maven
> > > >
> > > > It'll not help you but we have a similar problem with the site plugin : 
> > > > http://jira.codehaus.org/browse/MPSITE-22
> > > >
> > > > # Arnaud :-(
> > > >
> > > >
> > > > > -----Message d'origine-----
> > > > > De : dan tran [mailto:[EMAIL PROTECTED]
> > > > > Envoyé : jeudi 31 mars 2005 16:15
> > > > > À : Maven Users List
> > > > > Objet : Re: ANT FTP with Maven
> > > > >
> > > > > Did you load the ftp's ant task?  if you dont, it will not
> > > > > work inside maven.
> > > > > Check out the archive for instructions on how to load it
> > > > >
> > > > > -D
> > > > >
> > > > > On Mar 31, 2005 5:41 AM, GOKULAM Jayaram
> > > > > <[EMAIL PROTECTED]> wrote:
> > > > > > Hi Kenney,
> > > > > >
> > > > > > I tried the whole day, in repeating the same from my
> > > > > windows machine
> > > > > > using, an absolute path and to create a directory in the
> > > > > linux machine.
> > > > > > I was unsuccessful.
> > > > > >
> > > > > > I tried with in stalling FTP clients on my windows machine,
> > > > > >
> > > > > > Then adding the following jars in the Project.xml
> > > > > dependencies after
> > > > > > having placed them in my local repository NetComponents.jar
> > > > > > commons-net-1.3.0.jar jakarta-oro-2.0.8.jar
> > > > > >
> > > > > > Still I don't seem to get the FTP mkdir working.
> > > > > >
> > > > > > Please guide me to make this work.
> > > > > >
> > > > > > Thanks in advance,
> > > > > > Jayaram
> > > > > >
> > > > > > -----Original Message-----
> > > > > > From: Kenney Westerhof [mailto:[EMAIL PROTECTED]
> > > > > > Sent: Wednesday, March 30, 2005 8:40 PM
> > > > > > To: Maven Users List
> > > > > > Cc: [EMAIL PROTECTED]
> > > > > > Subject: RE: ANT FTP with Maven
> > > > > >
> > > > > > On Wed, 30 Mar 2005, GOKULAM Jayaram wrote:
> > > > > >
> > > > > > > Hi kenney,
> > > > > > >
> > > > > > > I referred the manual of ANT
> > > > > > >
> > > > > > > http://ant.apache.org/manual/OptionalTasks/ftp.html
> > > > > > >
> > > > > > > Which says that create directory will create a remote directory
> > > > > > beneath
> > > > > > > the default root directory.
> > > > > > >
> > > > > > > Can you please let me know, which is the default root
> > > > > directory in
> > > > > > > linux?
> > > > > > > I believe it is /root, if that's the case, my FTP mkdir
> > > > > still does
> > > > > > > not work.
> > > > > >
> > > > > > The ant manual is wrong - the name should be 'default home
> > > > > directory'.
> > > > > > At least, if you log in as a normal user. Then you can
> > > > > wander all over
> > > > > > the entire filesystem. If you use an anonymous account, you
> > > > > can only
> > > > > > see a part of the filesystem.
> > > > > >
> > > > > > If you'd try this:
> > > > > >
> > > > > >   <ant:ftp action="mkdir" server="${maven.remote.machine}"
> > > > > >       userid="${maven.remote.user}"
> > > > > password="${maven.remote.password}"
> > > > > >       remotedir="/tmp/TEST"
> > > > > >    />
> > > > > >
> > > > > > then the directory /tmp/TEST should be created.
> > > > > >
> > > > > > > What should be the problem?
> > > > > >
> > > > > > My guess is that you work on a windows machine, and
> > > > > ${maven.build.dir}
> > > > > > is something like
> > > > > >
> > > > > > C:\Documents\ And\ Settings\YourUserName\Desktop\Work\YourProject
> > > > > >
> > > > > > which is not a valid unix path.
> > > > > >
> > > > > > You should have a path like
> > > > > >
> > > > > >        /path/to/directory/you/want/to/create
> > > > > >
> > > > > > for an absolute path, or
> > > > > >
> > > > > >        directory/in/your/home/directory .
> > > > > >
> > > > > > Usually the ftp task is used for publishing websites and artifacts.
> > > > > > (see maven-jar-plugin et.al.)
> > > > > > You can test this all out using <echo>${maven.build.dir}</echo> and
> > > > > > trying to create that directory by hand using the windows
> > > > > ftp client.
> > > > > > But that's probably not the directory you want to create.
> > > > > >
> > > > > > O, and about your signature: ofcourse, I understand it's
> > > > > something you
> > > > > > cannot change - just wanted to point out that that policy makes no
> > > > > > sense when you send mail to an archived list ;)
> > > > > >
> > > > > > Greetings,
> > > > > >
> > > > > >        Kenney Westerhof
> > > > > >
> > > > > > >
> > > > > > > Thanks in advance,
> > > > > > > Jayaram
> > > > > > >
> > > > > > > -----Original Message-----
> > > > > > > From: Kenney Westerhof [mailto:[EMAIL PROTECTED]
> > > > > > > Sent: Wednesday, March 30, 2005 6:15 PM
> > > > > > > To: Maven Users List
> > > > > > > Cc: [EMAIL PROTECTED]
> > > > > > > Subject: Re: ANT FTP with Maven
> > > > > > >
> > > > > > > On Wed, 30 Mar 2005, GOKULAM Jayaram wrote:
> > > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > first of all: you might consider leaving the
> > > > > confidentiality footer
> > > > > > out,
> > > > > > > since this email is addressed to a list, not a person, and is
> > > > > > > readable by the whole world :)
> > > > > > >
> > > > > > > As you can read in
> > > > > > > http://ant.apache.org/manual/OptionalTasks/ftp.html
> > > > > > > nested fileset attributes are ignored in the ftp task. Instead it
> > > > > > > wil mkdir the ${maven.remote.dir}, but that probably already
> > > > > > exists,
> > > > > > > so nothing is printed/done.
> > > > > > >
> > > > > > > - Kenney
> > > > > > >
> > > > > > > > Hi all,
> > > > > > > >
> > > > > > > > Am trying to connect to FTP server of windows to linux, using a
> > > > > > > ant:ftp
> > > > > > > > from Maven.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > When I run the above goal, it just displays the task on the
> > > > > > > > console,
> > > > > > > and
> > > > > > > > it is not creating a directory as I wanted to.
> > > > > > > >
> > > > > > > > <goal name="remote:ftp" description="Copy the artifacts">
> > > > > > > >
> > > > > > > >
> > > > > > > >                   <ant:fileset dir="${maven.build.dir}" />
> > > > > > > >
> > > > > > > >               </ant:ftp>
> > > > > > > >
> > > > > > > >     </goal>
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Any help on the above issue would be great.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Thanks in advance.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Jayaram
> > > > > > > >
> > > > > > > > Confidentiality Statement:
> > > > > > > >
> > > > > > > > This message is intended only for the individual or entity to
> > > > > > > > which
> > > > > > it
> > > > > > > is addressed. It may contain privileged, confidential information
> > > > > > which
> > > > > > > is exempt from disclosure under applicable laws. If you
> > > > > are not the
> > > > > > > intended recipient, please note that you are strictly prohibited
> > > > > > > from disseminating or distributing this information
> > > > > (other than to
> > > > > > > the intended recipient) or copying this information. If you have
> > > > > > > received this communication in error, please notify us
> > > > > immediately
> > > > > > > by return email.
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Kenney Westerhof
> > > > > > > http://www.neonics.com
> > > > > > > GPG public key: http://www.gods.nl/~forge/kenneyw.key
> > > > > > >
> > > > > > >
> > > > > --------------------------------------------------------------------
> > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > > > >
> > > > > > > Confidentiality Statement:
> > > > > > >
> > > > > > > This message is intended only for the individual or
> > > > > entity to which
> > > > > > > it
> > > > > > is addressed. It may contain privileged, confidential information
> > > > > > which is exempt from disclosure under applicable laws. If
> > > > > you are not
> > > > > > the intended recipient, please note that you are strictly
> > > > > prohibited
> > > > > > from disseminating or distributing this information (other
> > > > > than to the
> > > > > > intended recipient) or copying this information. If you
> > > > > have received
> > > > > > this communication in error, please notify us immediately by return
> > > > > > email.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > --------------------------------------------------------------------
> > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > > > >
> > > > > > >
> > > > > >
> > > > > > --
> > > > > > Kenney Westerhof
> > > > > > http://www.neonics.com
> > > > > > GPG public key: http://www.gods.nl/~forge/kenneyw.key
> > > > > >
> > > > > >
> > > > > ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > > >
> > > > > > Confidentiality Statement:
> > > > > >
> > > > > > This message is intended only for the individual or entity
> > > > > to which it is addressed. It may contain privileged,
> > > > > confidential information which is exempt from disclosure
> > > > > under applicable laws. If you are not the intended recipient,
> > > > > please note that you are strictly prohibited from
> > > > > disseminating or distributing this information (other than to
> > > > > the intended recipient) or copying this information. If you
> > > > > have received this communication in error, please notify us
> > > > > immediately by return email.
> > > > > >
> > > > > >
> > > > > ---------------------------------------------------------------------
> > > > > > 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]
> > > > >
> > > >
> > > >
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > > Confidentiality Statement:
> > > >
> > > > This message is intended only for the individual or entity to which it 
> > > > is addressed. It may contain privileged, confidential information which 
> > > > is exempt from disclosure under applicable laws. If you are not the 
> > > > intended recipient, please note that you are strictly prohibited from 
> > > > disseminating or distributing this information (other than to the 
> > > > intended recipient) or copying this information. If you have received 
> > > > this communication in error, please notify us immediately by return 
> > > > email.
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > > --
> > > Kenney Westerhof
> > > http://www.neonics.com
> > > GPG public key: http://www.gods.nl/~forge/kenneyw.key
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > > Confidentiality Statement:
> > >
> > > This message is intended only for the individual or entity to which it is 
> > > addressed. It may contain privileged, confidential information which is 
> > > exempt from disclosure under applicable laws. If you are not the intended 
> > > recipient, please note that you are strictly prohibited from 
> > > disseminating or distributing this information (other than to the 
> > > intended recipient) or copying this information. If you have received 
> > > this communication in error, please notify us immediately by return email.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> > --
> > Kenney Westerhof
> > http://www.neonics.com
> > GPG public key: http://www.gods.nl/~forge/kenneyw.key
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> > Confidentiality Statement:
> >
> > This message is intended only for the individual or entity to which it is 
> > addressed. It may contain privileged, confidential information which is 
> > exempt from disclosure under applicable laws. If you are not the intended 
> > recipient, please note that you are strictly prohibited from disseminating 
> > or distributing this information (other than to the intended recipient) or 
> > copying this information. If you have received this communication in error, 
> > please notify us immediately by return email.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> --
> Kenney Westerhof
> http://www.neonics.com
> GPG public key: http://www.gods.nl/~forge/kenneyw.key
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> Confidentiality Statement:
>
> This message is intended only for the individual or entity to which it is 
> addressed. It may contain privileged, confidential information which is 
> exempt from disclosure under applicable laws. If you are not the intended 
> recipient, please note that you are strictly prohibited from disseminating or 
> distributing this information (other than to the intended recipient) or 
> copying this information. If you have received this communication in error, 
> please notify us immediately by return email.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to