works for me in beta-3:
pom.xml:
same as yours without dependencies
build.xml:
<project default="foo">
<target name="foo">
<echo>foo</echo>
<copy tofile="pom2" file="pom.xml" />
</target>
</project>
output from m2 compile:
[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
foo:
[echo] foo
[copy] Copying 1 file to C:\home\Brett\scratch\test-runs\antrun2
[INFO] Executed tasks
On 10/6/05, Mattias Arbin <[EMAIL PROTECTED]> wrote:
> Yann.
> Below is my pom. If I run 'm2 compile' it seems like the generate-sources
> phase is never executed.
> Yes, I tried to add an 'echo' task.
> /Mattias
>
> <?xml version="1.0" ?>
> <project
> xsi:schemaLocation="http://maven.apache.org/maven-v4_0_0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <groupId>xxxx-ratereview</groupId>
> <artifactId>ratereview-clients</artifactId>
> <packaging>jar</packaging>
> <version>1.0-SNAPSHOT</version>
> <name>RateReview Clients</name>
> <url>http://maven.apache.org</url>
> <build>
> <plugins>
> <plugin>
>
> <artifactId>maven-compiler-plugin</artifactId>
> <configuration>
> <source>1.5</source>
> <target>1.5</target>
> <compileSourceRoots>
> <compileSourceRoot>
> /src/main/java
> </compileSourceRoot>
> <compileSourceRoot>
>
> /target/generated-sources
> </compileSourceRoot>
> </compileSourceRoots>
> </configuration>
> </plugin>
> <plugin>
> <artifactId>maven-antrun-plugin</artifactId>
> <executions>
> <execution>
>
> <phase>generate-sources</phase>
> <configuration>
> <tasks>
> <ant
> antfile="build.xml"/>
> </tasks>
> </configuration>
> <goals>
> <goal>run</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> </plugins>
> </build>
> <dependencies>
> <dependency>
> <groupId>axis</groupId>
> <artifactId>axis</artifactId>
> <version>1.2.1</version>
> </dependency>
> <dependency>
> <groupId>commons-discovery</groupId>
> <artifactId>commons-discovery</artifactId>
> <version>0.2</version>
> </dependency>
> <dependency>
> <groupId>axis</groupId>
> <artifactId>axis-wsdl4j</artifactId>
> <version>1.5.1</version>
> </dependency>
> <dependency>
> <groupId>axis</groupId>
> <artifactId>axis-jaxrpc</artifactId>
> <version>1.2.1</version>
> </dependency>
> <dependency>
> <groupId>axis</groupId>
> <artifactId>axis-ant</artifactId>
> <version>1.2.1</version>
> </dependency>
> <dependency>
> <groupId>axis</groupId>
> <artifactId>axis-saaj</artifactId>
> <version>1.2.1</version>
> </dependency>
> <dependency>
> <groupId>javax.activation</groupId>
> <artifactId>activation</artifactId>
> <version>1.0.2</version>
> </dependency>
> <dependency>
> <groupId>javax.mail</groupId>
> <artifactId>mail</artifactId>
> <version>1.3.2</version>
> </dependency>
> <dependency>
> <groupId>jgoodies</groupId>
> <artifactId>forms</artifactId>
> <version>1.0.5</version>
> </dependency>
>
> </dependencies>
> <build>
> <finalName>ratereview-clients</finalName>
> </build>
> </project>
>
>
> > -----Ursprungligt meddelande-----
> > Från: Yann Le Du [mailto:[EMAIL PROTECTED]
> > Skickat: den 5 oktober 2005 16:53
> > Till: Maven Users List
> > Ämne: RE: SV: [m2b3] antrun problems
> >
> > Hmm, that's pretty strange, because, according to the Build
> > Lifecycle, calling compile should indeed call
> > generate-sources. I tried it and it's working.
> >
> > What is the type of your artifact, jar or other ? Can you
> > send your whole POM ?
> >
> > Just to be sure... :) did you try to replace your task by a
> > simple <echo message="Hello, world !"/>
> >
> > Yann
> >
> >
> > --- Mattias Arbin <[EMAIL PROTECTED]> a écrit :
> >
> > > Thanks Yann.
> > > I will try this.
> > > However, what I initially wanted to do was indeed to
> > execute this ant
> > > task in the generate-source phase. (It is a java2wsdl task that
> > > generates java
> > > source)
> > > I thought that the configuration previously sent would
> > automatically
> > > be executed before the compile phase.
> > > So, for instance, if I would type
> > > m2 compile
> > > the ant task would be executed. But nothing happens at all.
> > Maven does
> > > not seem to enter the generate-sources phase.
> > > Am I missing something?
> > > Thanks,
> > > Mattias
> > >
> > > -----Ursprungligt meddelande-----
> > > Från: Yann Le Du [mailto:[EMAIL PROTECTED]
> > > Skickat: den 5 oktober 2005 16:17
> > > Till: Maven Users List
> > > Kopia: [EMAIL PROTECTED]
> > > Ämne: RE: [m2b3] antrun problems
> > >
> > > Hi Mattias,
> > >
> > > By <phase>generate-sources</phase> , you mean that your
> > > <configuration> must only be used in generate-sources
> > phase (see [1] for details on phases).
> > > Calling m2 antrun:run doesn't go into this phase, so it's normal
> > > build.xml isn't called.
> > >
> > > If you want your <configuration> be always used, put it
> > direclty into
> > > <plugin>
> > > :
> > >
> > > ~ <plugin>
> > > ~ <artifactId>maven-antrun-plugin</artifactId>
> > > ~ <configuration>
> > > ~ <tasks>
> > > ~ <ant antfile="build.xml"/>
> > > ~ </tasks>
> > > ~ </configuration>
> > > ~ <goals>
> > > ~ <goal>run</goal>
> > > ~ </goals>
> > > ~ </plugin>
> > >
> > > Thinking of it, it's probably the same kind of problem that was
> > > reported here :
> > >
> > http://marc.theaimsgroup.com/?l=turbine-maven-user&m=112835518711351&w
> > > =2
> > >
> > > [1] http://maven.apache.org/maven2/lifecycle.html
> > >
> > > Regards,
> > > Yann
> > >
> > >
> > > --- Mattias Arbin <[EMAIL PROTECTED]> a écrit :
> > >
> > > > Could someone please tell what's wrong here:
> > > >
> > > >
> > > >
> > > > I want to execute an ant build file. The filename is build.xml,
> > > > which is located in the same location as the pom.xml. It
> > has a default target.
> > > >
> > > >
> > > >
> > > > In pom.xml, I have:
> > > >
> > > >
> > > >
> > > > .
> > > >
> > > > <plugin>
> > > >
> > > > <artifactId>maven-antrun-plugin</artifactId>
> > > >
> > > > <executions>
> > > >
> > > > <execution>
> > > >
> > > > <phase>generate-sources</phase>
> > > >
> > > > <configuration>
> > > >
> > > > <tasks>
> > > >
> > > > <ant antfile="build.xml"/>
> > > >
> > > > </tasks>
> > > >
> > > > </configuration>
> > > >
> > > > <goals>
> > > >
> > > > <goal>run</goal>
> > > >
> > > > </goals>
> > > >
> > > > </execution>
> > > >
> > > > </executions>
> > > >
> > > > </plugin>
> > > >
> > > > .
> > > >
> > > >
> > > >
> > > > When executing (see below) no ant tasks seem to be run.
> > > >
> > > > Any ideas?
> > > >
> > > >
> > > >
> > > > /Mattias
> > > >
> > > >
> > > >
> > > > C:\work\ratereview\clients\trunk>m2 -X antrun:run
> > > >
> > > > + Error stacktraces are turned on.
> > > >
> > > > [DEBUG] Building Maven user-level plugin registry from:
> > > > 'C:\Documents and Settings\mattiasar\.m2\plugin-registry.xml'
> > > >
> > > > [DEBUG] Building Maven global-level plugin registry from:
> > > > 'C:\java\MAVEN-~1.0-B\bin\..\conf\plugin-registry.xml'
> > > >
> > > > [INFO] Searching repository for plugin with prefix: 'antrun'.
> > > >
> > > > [DEBUG] maven-antrun-plugin: resolved to version 1.0-rc1 from
> > > > repository central
> > > >
> > > > [INFO]
> > > >
> > >
> > ----------------------------------------------------------------------
> > > ------
> > > >
> > > > [INFO] Building RateReview Clients
> > > >
> > > > [INFO] task-segment: [antrun:run]
> > > >
> > > > [INFO]
> > > >
> > >
> > ----------------------------------------------------------------------
> > > ------
> > > >
> > > > [DEBUG] eniro-ratereview:ratereview-clients:jar:1.0-SNAPSHOT
> > > > (selected for
> > > > null)
> > > >
> > > > [DEBUG] axis:axis-wsdl4j:jar:1.5.1 (selected for compile)
> > > >
> > > > [DEBUG] axis:axis-jaxrpc:jar:1.2.1 (selected for compile)
> > > >
> > > > [DEBUG] axis:axis-saaj:jar:1.2.1 (selected for compile)
> > > >
> > > > [DEBUG] commons-discovery:commons-discovery:jar:0.2
> > (selected for
> > > compile)
> > > >
> > > > [DEBUG] junit:junit:jar:3.7 (selected for compile)
> > > >
> > > > [DEBUG] commons-logging:commons-logging:jar:1.0.3
> > (selected for
> > > compile)
> > > >
> > > > [DEBUG] junit:junit:jar:3.7 (removed - nearer found: 3.7)
> > > >
> > > > [DEBUG] junit:junit:jar:3.7 (selected for compile)
> > > >
> > > > [DEBUG] logkit:logkit:jar:1.0.1 (selected for compile)
> > > >
> > > > [DEBUG] log4j:log4j:jar:1.2.6 (selected for compile)
> > > >
> > > > [DEBUG] jgoodies:forms:jar:1.0.5 (selected for compile)
> > > >
> > > > [DEBUG] axis:axis-ant:jar:1.2.1 (selected for compile)
> > > >
> > > > [DEBUG] javax.mail:mail:jar:1.3.2 (selected for compile)
> > > >
> > > > [DEBUG] javax.activation:activation:jar:1.0.2
> > (selected for compile)
> > > >
> > > > [DEBUG] axis:axis:jar:1.2.1 (selected for compile)
> > > >
> > > > [DEBUG] javax.activation:activation:jar:1.0.2 (removed
> > - nearer found:
> > > > 1.0.2)
> > > >
> > > > [DEBUG] javax.activation:activation:jar:1.0.2 (selected
> > for compile)
> > > >
> > > > [DEBUG]
> > > > org.apache.maven.plugins:maven-antrun-plugin:maven-plugin:1.0-rc1
> > > > (selected for runtime)
> > > >
> > > > [DEBUG] ant:ant:jar:1.6.5 (selected for runtime)
> > > >
> > > > [DEBUG] ant:ant-launcher:jar:1.6.5 (selected for runtime)
> > > >
> > > > [INFO] [antrun:run]
> > > >
> > > > [INFO] Executing tasks
> > > >
> > > > [INFO] Executed tasks
> > > >
> > > > [INFO]
> > > >
> > >
> > ----------------------------------------------------------------------
> > > ------
> > > >
> > > > [INFO] BUILD SUCCESSFUL
> > > >
> > > > [INFO]
> > > >
> > >
> > ----------------------------------------------------------------------
> > > ------
> > > >
> > > > [INFO] Total time: < 1 second
> > > >
> > > > [INFO] Finished at: Wed Oct 05 14:50:21 CEST 2005
> > > >
> > > > [INFO] Final Memory: 1M/4M
> > > >
> > > > [INFO]
> > > >
> > >
> > ----------------------------------------------------------------------
> > > ------
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > ______________________________________________________________________
> > > _____ Appel audio GRATUIT partout dans le monde avec le
> > nouveau Yahoo!
> > > Messenger Téléchargez cette version sur
> > http://fr.messenger.yahoo.com
> > >
> > >
> > ---------------------------------------------------------------------
> > > 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]
> > >
> > >
> >
> >
> >
> >
> >
> >
> >
> > ______________________________________________________________
> > _____________
> > Appel audio GRATUIT partout dans le monde avec le nouveau
> > Yahoo! Messenger Téléchargez cette version sur
> > http://fr.messenger.yahoo.com
> >
> > ---------------------------------------------------------------------
> > 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]