You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Saloucious <sa...@gmail.com> on 2008/03/21 14:20:34 UTC

Plugins vs Ant tasks

Hi,

i would like to know what is recommanded by Maven Team when a procces does
not fit with any plugins/goals provides by Maven.

Just for example, if i want to touch a file, what is better : create a
my.company.plugin.touch or add a simple antrun task ?

Thanks
-- 
View this message in context: http://www.nabble.com/Plugins-vs-Ant-tasks-tp16197720s177p16197720.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Plugins vs Ant tasks

Posted by Graham Leggett <mi...@sharp.fm>.
Siarhei Dudzin wrote:

> There is one big difference between a plugin and an ant-script that is run
> via ant-tasks (I think you meant a ant-run plugin here?):

I was referring to an ant script embedded within the antrun plugin, 
bound to a phase, as opposed to a maven plugin bound to a phase.

Regards,
Graham
--

Re: Plugins vs Ant tasks

Posted by Siarhei Dudzin <si...@gmail.com>.
There is one big difference between a plugin and an ant-script that is run
via ant-tasks (I think you meant a ant-run plugin here?):

Maven plugin is *based* on the standard build lifecycle and is by definition
reusable (standard declaration and is kept in a repository, again at the
standard location) while ant is an ad-hoc solution (you have to copy/paste
the script to reuse it).

On Sun, Mar 23, 2008 at 4:22 PM, Graham Leggett <mi...@sharp.fm> wrote:

> Saloucious wrote:
>
> > i would like to know what is recommanded by Maven Team when a procces
> does
> > not fit with any plugins/goals provides by Maven.
> >
> > Just for example, if i want to touch a file, what is better : create a
> > my.company.plugin.touch or add a simple antrun task ?
>
> I don't think it matters much - on condition the ant script doesn't
> violate the maven design rules.
>
> I have noticed though that people who write ant scripts like adding
> arbitrary and undocumented requirements onto other developers,
> especially when it comes to some weird directory structure that you
> need, or hard coded paths in the development environment.
>
> Writing a maven plugin instead can prevent many of these headaches in
> the long term, although it might mean more work in the short term.
>
> Regards,
> Graham
> --
>

Re: Plugins vs Ant tasks

Posted by Graham Leggett <mi...@sharp.fm>.
Saloucious wrote:

> i would like to know what is recommanded by Maven Team when a procces does
> not fit with any plugins/goals provides by Maven.
> 
> Just for example, if i want to touch a file, what is better : create a
> my.company.plugin.touch or add a simple antrun task ?

I don't think it matters much - on condition the ant script doesn't 
violate the maven design rules.

I have noticed though that people who write ant scripts like adding 
arbitrary and undocumented requirements onto other developers, 
especially when it comes to some weird directory structure that you 
need, or hard coded paths in the development environment.

Writing a maven plugin instead can prevent many of these headaches in 
the long term, although it might mean more work in the short term.

Regards,
Graham
--

Re: Plugins vs Ant tasks

Posted by Dennis Lundberg <de...@apache.org>.
Saloucious wrote:
> Hi,
> 
> i would like to know what is recommanded by Maven Team when a procces does
> not fit with any plugins/goals provides by Maven.
> 
> Just for example, if i want to touch a file, what is better : create a
> my.company.plugin.touch or add a simple antrun task ?

If you create your own plugin you can reuse it in several of your projects.
If you add an antrun task it's only available in that particular project.

-- 
Dennis Lundberg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Plugins vs Ant tasks

Posted by Alexandre Touret <at...@free.fr>.

In my opinion, if you want to produce a 'one shot' action and you dont care
about reusability - which is the case of your touch plugin- you may run an
antrun plugin inside a phase. Else, if you want to produce a reusable
action, you should work to a mojo plugin

Alexandre



Saloucious wrote:
> 
> Hi,
> 
> i would like to know what is recommanded by Maven Team when a procces does
> not fit with any plugins/goals provides by Maven.
> 
> Just for example, if i want to touch a file, what is better : create a
> my.company.plugin.touch or add a simple antrun task ?
> 
> Thanks
> 

-- 
View this message in context: http://www.nabble.com/Plugins-vs-Ant-tasks-tp16197720s177p16197917.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org