You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Benoit Xhenseval <be...@yahoo.com> on 2006/07/19 21:29:57 UTC
[M1] Using optional Ant FTP changed between M1.02 and M1.1?
Hello All,
Under M1.0.2, I used the elegant solution for sending some "stuff" (i.e. NOT artifact) via FTP to servers as explained here:
http://glaforge.free.fr/weblog/index.php?itemid=114
Download NetComponents from: http://www.savarese.org/oro/downloads/NetComponents-1.3.8.tar.gz Uncompress the archive, take the NetComponent.jar and put it in a new directory:
${user.home}/.maven/repository/net-components Rename the jar to NetComponents-1.3.8a.jar Add the dependency in your project.xml: <dependency>
<groupId>net-components</groupId>
<artifactId>NetComponents</artifactId>
<version>1.3.8a</version>
<properties>
<classloader>root</classloader>
</properties>
</dependency>
The <properties><classloader>root</properties></classloader> is there to tell Maven to load that dependency with its root classloader, so that it is available to Maven's Ant which is loaded by that root classloader.
Now, you can add a goal in your maven.xml file to call the FTP task, and don't forget to create a task definition: <?xml version="1.0" encoding="UTF-8"?>
<project default="java:compile" xmlns:ant="jelly:ant">
<goal name="ftp">
<taskdef name="ftp" classname="org.apache.tools.ant.taskdefs.optional.net.FTP"/>
<ant:ftp server="yourserver.domain.com" userid="foo" password="bar"
action="list" listing="list.txt">
<fileset>
<include name="*.html"/>
</fileset>
</ant:ftp>
</goal>
</project>
Unfortunately this no longer works under Maven 1.1-b3... Could somebody tells me what has changed? and how it could be fixed?
Is it related to the classloader? root
Many thanks in advance,
Benoit