good morning hutieuxao-

the example progresses up to providing 'filename'
how is 'filename' used afterwards?

thanks,
Martin
______________________________________________ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de 
déni et de confidentialité 
This message is confidential. If you should not be the intended receiver, then 
we ask politely to report. Each unauthorized forwarding or manufacturing of a 
copy is inadmissible. This message serves only for the exchange of information 
and has no legal binding effect. Due to the easy manipulation of emails we 
cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.






> Date: Sun, 12 Apr 2009 03:57:59 -0700
> From: [email protected]
> To: [email protected]
> Subject: Re: How to call ant task from maven - can not find a good example
> 
> 
> Hope that the below example can help you somehow:
> 
> <project>
> 
>   ...
> 
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-antrun-plugin</artifactId>
>         <version>1.3</version>
>         <executions>
>           <execution>
>             <id>ant-calling-example</id>
>             <phase>generate-sources</phase>
>             <goals>
>               <goal>run</goal>
>             </goals>
>             <configuration>
>               <tasks>
>                 <!-- Core Ant tasks can be used as you use in build.xml -->
>                 <echo>Hello World</echo>
>                 <mkdir
> dir="${project.build.directory}/generated-sources/newdir" />
> 
>                 <!-- Even Ant-Contrib tasks, remember to add Ant-Contrib
>                      dependency to your test classpath -->
>                 <taskdef name="for"
> classname="net.sf.antcontrib.logic.ForTask"
>                     classpathref="maven.test.classpath" />
>                 <taskdef name="var"
> classname="net.sf.antcontrib.property.Variable"
>                     classpathref="maven.test.classpath" />
> 
>                 <fileset id="demo.files"
> dir="${project.basedir}/src/main/demofiles">
>                   <include name="1.txt" />
>                   <include name="2.txt" />
>                 </fileset>
> 
>                 <for param="filename">
>                   <fileset refid="demo.files" />
>                   <sequential>
>                     <echo>@filename</echo>
>                   </sequential>
>                 </for>
> 
>                 <!-- Call a target in Ant build file -->
> 
>                 <!-- These properties will be passed to Ant target -->
>                 <property name="foo" value="Foo Foo" />
>                 <property name="bar" value="Bar bar" />
> 
>                 <ant antfile="build.xml" target="demo-target" />
>               </tasks>
>             </configuration>
>           </execution>
>         </executions>
>       </plugin>
>     </plugins>
>   </build>
> 
>   <dependencies>
>     <!-- For Ant-Contrib tasks -->
>     <dependency>
>       <groupId>ant-contrib</groupId>
>       <artifactId>ant-contrib</artifactId>
>       <version>1.0b3</version>
>       <scope>test</scope>
>     </dependency>
>   </dependencies>
> 
>   ...
> 
> </project>
> 
> 
> 
> CheapLisa wrote:
> > 
> > thanks, I'm still lost.  This section did not make much sense to me.
> > 
> > 
> > 
> > David M. Karr wrote:
> >> 
> >> CheapLisa wrote:
> >>> I want to call some ant tasks when I run maven.
> >>> 
> >>> I have read all about the maven antrun plugin and found some
> >>> examples, but the documentation is a wee bit hard
> >>> for me to understand, and does not lead me to what I wish to accomplish.
> >>> 
> >>> I want all my ant tasks in a build.xml file (not in the pom.xml).
> >>> 
> >>> But when I execute:  mvn compile install
> >>> 
> >>> I want it to run (by default) one or more ant tasks 
> >>> (in a specific order) that are in the build.xml.
> >>> 
> >>> Is there a way to do this?  When I type $mvn compile install I want
> >>> the build process to be oblivous to the fact that ant is being called,
> >>> unless there is a problem.
> >>> 
> >>> If the ant tasks fails, I want to fail the build as well.
> >>> 
> >>> thanks
> >> 
> >> I would assume the following is a good example of this kind of thing: 
> >> <http://www.sonatype.com/books/maven-book/reference/lifecycle.html>.
> >> 
> >> You would use the "compile" phase instead of "pre-clean", and the inline 
> >> task configuration would just use an "ant" task to call a target in your 
> >> buildfile.
> >> 
> >> I don't know whether a failure in the Ant script will cause a top-level 
> >> build failure.
> >> 
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [email protected]
> >> For additional commands, e-mail: [email protected]
> >> 
> >> 
> >> 
> > 
> > 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/How-to-call-ant-task-from-maven---can-not-find-a-good-example-tp22992996p23010072.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 

_________________________________________________________________
Rediscover Hotmail®: Get quick friend updates right in your inbox. 
http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Updates1_042009

Reply via email to