maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milos Kleint <>
Subject Re: Proposal: Maven launchers in the POM
Date Wed, 16 Jun 2010 08:28:29 GMT
you can already do this with netbeans afaik.
1. add the configuration of plugins in a profile
2. in nb ui, create a custom action in project properties/Actions
3. name the action, enable the given profile and execute the goals
4. done, run the action from project popup. (if you want it global - for all
projects just set in Tool/Options/Misc

I'm sure the m2eclipse' configurations can do the same.


On Wed, Jun 16, 2010 at 10:20 AM, Jochen Wiedmann <
> wrote:

> Hi,
> I have already posted the same suggestion on the M2Eclipse mailing
> list, with very limited response, so'd like to try it once more, and
> with a wider audience.
> In the times when I was using "make", or "ant", there have always been
> some standard targets like "all", "install", "clean" and so on. These
> are perfectly met by the respective lifecycle phases, or plugins.
> However, quite frequently, make or build files also used to contain
> some additional targets, which have been project specific and which
> have also been invoked from the command line. Ant went so far as to
> show these special targets by using "ant -projecthelp".
> The requirement for these things is still there. For example, I've got
> a project with some 30 modules. There are exactly 3 of them, in which
> I frequently do the following:
>    - Run "mvn dependency:copy-dependencies"
>    - Copy these dependencies to a particular folder
>    - Copy the projects jar file to the same folder
>    - Possible remove some jar files, which have gone from the dependency
> list.
> Quite obviously, this would be a perfect thing for such a "special
> target" like above.
> I can resolve this by writing a script. But that script wouldn't be
> portable, or it introduces additional dependencies on some scripting
> language, or the like. Why not do it with Maven? Besides, this would
> me my personal solution. A much better solution would be if Maven
> itself, or at least the tools gathering around the Maven world would
> know my solution? For example "mvn help:projecthelp" might show me the
> special targets. So could the "Run As..." dialog in a Eclipse or
> NetBeans plugin.
> A Maven launcher could invoke a certain Maven goal, enabling or
> disabling certain profiles. In other words, the POM entry could look
> something like this:
>    <launcher>
>        <id>copy-release-dependencies</id>
>        <launchedItems>
>             <launchedLifecyclePhase>package</launchedLifecyclePhase>
>             <launchedPlugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-dependency-plugin</artifactId>
>                <goal>copy-dependencies</goal>
>                ... more properties possible here, roughly comparable
> to a plugin execution
>             </launchedPlugin>
>             <launchedPlugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-antrun-plugin</artifactId>
>             </launchedPlugin>
>             ...
>        </launchedItems>
>        <enabledProfiles>
>            <enabledProfile>release</enabledProfile>
>        </enabledProfiles>
>    </launcher>
> The idea would be that I invoke Maven roughly like "mvn -launcher
> cop-release-dependencies". Maven would iterate over the list of
> launched plugins and, for every such plugin, invoke itself using the
> Maven embedder and call the respective goal. In other words, this
> would invoke
>    mvn package
>    mvn dependency:copy-dependencies
>    mvn antrun:run
>    ...
> No lifecycle considerations, or stuff like that, so that the
> implementation could be relatively simple.
> Jochen
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message