You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Andy Schlaikjer <ha...@cs.cmu.edu> on 2008/10/15 02:31:33 UTC
must I bind antrun:run to a phase?
Hi all,
I'm interested in running the maven-antrun-plugin by listing
"antrun:run" as a default goal in a custom Profile, but this seems not
to be working. Am I doing something wrong, or am I forced to bind the
execution to a phase for antrun to actually execute its tasks?
###pom.xml###
<project>
...
<profiles>
<profile>
<id>echo</id>
<activation>
<property>
<name>command</name>
<value>echo</value>
</property>
</activation>
<build>
<defaultGoal>antrun:run</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<configuration>
<tasks>
<echo message="Hello World" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
...
</project>
###pom.xml###
When I try to run Maven using this profile, the echo doesn't come through:
$ mvn -Dcommand=echo
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'antrun'.
[INFO]
------------------------------------------------------------------------
[INFO] Building Example Project
[INFO] task-segment: [antrun:run]
[INFO]
------------------------------------------------------------------------
[INFO] [antrun:run]
[INFO] Executing tasks
[INFO] Executed tasks
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Oct 14 20:00:31 EDT 2008
[INFO] Final Memory: 3M/7M
[INFO]
------------------------------------------------------------------------
If I add to the profile above an explicit phase to the execution, the
echo happens normally.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: must I bind antrun:run to a phase?
Posted by Brett Porter <br...@apache.org>.
remove the <executions>/<execution> wrapper and it should work.
This looks like something that would be potentially confusing, however.
- Brett
On 15/10/2008, at 11:31 AM, Andy Schlaikjer wrote:
> Hi all,
>
> I'm interested in running the maven-antrun-plugin by listing
> "antrun:run" as a default goal in a custom Profile, but this seems
> not to be working. Am I doing something wrong, or am I forced to
> bind the execution to a phase for antrun to actually execute its
> tasks?
>
> ###pom.xml###
> <project>
> ...
> <profiles>
> <profile>
> <id>echo</id>
> <activation>
> <property>
> <name>command</name>
> <value>echo</value>
> </property>
> </activation>
> <build>
> <defaultGoal>antrun:run</defaultGoal>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-antrun-plugin</artifactId>
> <version>1.3</version>
> <executions>
> <execution>
> <configuration>
> <tasks>
> <echo message="Hello World" />
> </tasks>
> </configuration>
> </execution>
> </executions>
> </plugin>
> </plugins>
> </build>
> </profile>
> </profiles>
> ...
> </project>
> ###pom.xml###
>
> When I try to run Maven using this profile, the echo doesn't come
> through:
>
> $ mvn -Dcommand=echo
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix: 'antrun'.
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Example Project
> [INFO] task-segment: [antrun:run]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] [antrun:run]
> [INFO] Executing tasks
> [INFO] Executed tasks
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 2 seconds
> [INFO] Finished at: Tue Oct 14 20:00:31 EDT 2008
> [INFO] Final Memory: 3M/7M
> [INFO]
> ------------------------------------------------------------------------
>
> If I add to the profile above an explicit phase to the execution,
> the echo happens normally.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
--
Brett Porter
brett@apache.org
http://blogs.exist.com/bporter/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org