Discussion:
maven-antrun-plugin: Need phase indenedence and/or conditional processing
Farrukh S. Najmi
2007-03-30 14:15:38 UTC
Permalink
I am using maven-antrun-plugin in my pom to run a java program.
I do not need it to be tied to any phase.
All I need is to be able to run it on demand by specifying an
appropriate goal and some command line options using -D.

So far I am able make it work but only if it is tied to a phase. See my
pom at:

<http://ebxmlrr.sourceforge.net/private/pom.xml>

Ideally I wish it not be tied to a phase and instead tied to a task name
that I can invoke from the command line.
If it must be tied to a phase then I would like to have conditional
processing in the ant task
so that if certain required properties are not set in command line I can
simply skip the execution of
the core steps in the ant task silently.

I feel I am close. Any idea how to get the phase independent execution
and/or conditional execution?

Thanks in advance.
--
Regards,
Farrukh

Web: http://www.wellfleetsoftware.com
Napoleon Esmundo Ramirez
2007-03-30 15:24:28 UTC
Permalink
Hello,

As far as NOT binding a goal to a phase is concerned, all you have to do is
configure the plugin and don't declare any execution. In your case, instead
of placing <configuration> inside <execution>, place it directly under
<plugin>, and remove <executions> then you can explicitly invoke it using
`mvn antrun:run'. You can verify the plugin configuration syntax at the pom
technical reference at
http://maven.apache.org/ref/current/maven-model/maven.html#class_plugin .

As for the conditional execution, you may have been referring to profiles.
Specific parameters/properties passed through the command line may activate
a profile. More details at
http://maven.apache.org/guides/introduction/introduction-to-profiles.html .

Cheers!
Nap
Post by Farrukh S. Najmi
I am using maven-antrun-plugin in my pom to run a java program.
I do not need it to be tied to any phase.
All I need is to be able to run it on demand by specifying an
appropriate goal and some command line options using -D.
So far I am able make it work but only if it is tied to a phase. See my
<http://ebxmlrr.sourceforge.net/private/pom.xml>
Ideally I wish it not be tied to a phase and instead tied to a task name
that I can invoke from the command line.
If it must be tied to a phase then I would like to have conditional
processing in the ant task
so that if certain required properties are not set in command line I can
simply skip the execution of
the core steps in the ant task silently.
I feel I am close. Any idea how to get the phase independent execution
and/or conditional execution?
Thanks in advance.
--
Regards,
Farrukh
Web: http://www.wellfleetsoftware.com
---------------------------------------------------------------------
vetalok
2007-04-03 16:06:44 UTC
Permalink
Wayne Fay, thanks a million!
I had the problem like this and could not find the solution - I just want to
turn off some plugin and this is was very difficult to find the solution...
Your advice is very useful!
It saved me a lot of time.
Thanks!
Post by Napoleon Esmundo Ramirez
Hello,
As far as NOT binding a goal to a phase is concerned, all you have to do is
configure the plugin and don't declare any execution. In your case, instead
of placing <configuration> inside <execution>, place it directly under
<plugin>, and remove <executions> then you can explicitly invoke it using
`mvn antrun:run'. You can verify the plugin configuration syntax at the pom
technical reference at
http://maven.apache.org/ref/current/maven-model/maven.html#class_plugin .
As for the conditional execution, you may have been referring to profiles.
Specific parameters/properties passed through the command line may activate
a profile. More details at
http://maven.apache.org/guides/introduction/introduction-to-profiles.html .
Cheers!
Nap
Post by Farrukh S. Najmi
I am using maven-antrun-plugin in my pom to run a java program.
I do not need it to be tied to any phase.
All I need is to be able to run it on demand by specifying an
appropriate goal and some command line options using -D.
So far I am able make it work but only if it is tied to a phase. See my
<http://ebxmlrr.sourceforge.net/private/pom.xml>
Ideally I wish it not be tied to a phase and instead tied to a task name
that I can invoke from the command line.
If it must be tied to a phase then I would like to have conditional
processing in the ant task
so that if certain required properties are not set in command line I can
simply skip the execution of
the core steps in the ant task silently.
I feel I am close. Any idea how to get the phase independent execution
and/or conditional execution?
Thanks in advance.
--
Regards,
Farrukh
Web: http://www.wellfleetsoftware.com
---------------------------------------------------------------------
--
View this message in context: http://www.nabble.com/maven-antrun-plugin%3A-Need-phase-indenedence-and-or-conditional-processing-tf3492506s177.html#a9816798
Sent from the Maven - Users mailing list archive at Nabble.com.
Wayne Fay
2007-03-30 15:25:37 UTC
Permalink
I would not use maven-antrun-plugin in this case. Instead I would just
use Ant with a build.xml file.

Then if you need to use this Ant task during your build, you can call
it from m-a-p.

Wayne
Post by Farrukh S. Najmi
I am using maven-antrun-plugin in my pom to run a java program.
I do not need it to be tied to any phase.
All I need is to be able to run it on demand by specifying an
appropriate goal and some command line options using -D.
So far I am able make it work but only if it is tied to a phase. See my
<http://ebxmlrr.sourceforge.net/private/pom.xml>
Ideally I wish it not be tied to a phase and instead tied to a task name
that I can invoke from the command line.
If it must be tied to a phase then I would like to have conditional
processing in the ant task
so that if certain required properties are not set in command line I can
simply skip the execution of
the core steps in the ant task silently.
I feel I am close. Any idea how to get the phase independent execution
and/or conditional execution?
Thanks in advance.
--
Regards,
Farrukh
Web: http://www.wellfleetsoftware.com
---------------------------------------------------------------------
Loading...