You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by nicolas de loof <ni...@apache.org> on 2008/01/08 21:19:44 UTC

any maven support for "macros" ?

Hello,

To release my project I need to call a rather complex maven command :
"mvn install assembly:attached com.mycompany:myplugin:post-goal"

I'd like to provide in my corporate POM some "macro command" to define
custom goals / lifecycle phases to run such commands.

example : "mvn release" to create the release.

Is there any way to create such macro-commands with maven, when the standard
lifecycle is not enough ? I don't thing so, but maybe some combination of
profiles and invoker plugin could help ?

Nico.

[solved] any maven support for "macros" ?

Posted by nicolas de loof <ni...@apache.org>.
FYI, I've found an interesting solution in apache CXF :

mvn -Psetup
--> does a fast-minimal build and runs eclipse:eclipse

The idea is to use a profile to bind some plugins to validate phase.

Nico.

2008/1/9, nicolas de loof <ni...@apache.org>:
>
> The assembly plugin requires the package goal to be run prior (to get
> acces to modules). mvn assembly:assembly fails with "xx-ear project has no
> file" !
> -> mvn package assembly:attached (as described in plugin doc)
>
> My project has some modules that builds maven plugins, used on other
> modules, so install is required
> -> mvn install assembly:attached
>
> Next, my custom plugin works on the tar.gz produced by the assembly, so
> must run next
> -> mvn install assembly:attached com.mycompany:myplugin:custom-goal
>
> I could force an @execute goal=assembly:assembly in my custom plugin, but
> still nedd to run package before the assembly to work.
>
>
> 2008/1/8, Michael McCallum <gh...@apache.org>:
> >
> > why are you trying to 'release' with the install plugin?
> >
> > you should use the release plugin and bind the assembly and custom
> > plugin to a
> > phase of the project lifecycle, its all very well documented all over
> > the
> > place....
> >
> > <plugin>
> > <artifactId>maven-assembly-plugin</artifactId>
> > <version>2.2-beta-1</version>
> > <executions>
> > <execution>
> >   <phase>package</phase>
> >   <goals>
> >    <goal>attached</goal>
> >   </goals>
> >   <configuration>
> >    <descriptors>
> >     <descriptor>src/main/assembly/aggregation.xml</descriptor>
> >    </descriptors>
> >    <outputDirectory>target/assembly</outputDirectory>
> >    <workDirectory>target/assembly/work</workDirectory>
> >   </configuration>
> > </execution>
> > </executions>
> > </plugin>
> >
> > On Wed, 09 Jan 2008 09:19:44 nicolas de loof wrote:
> > > Hello,
> > >
> > > To release my project I need to call a rather complex maven command :
> > > "mvn install assembly:attached com.mycompany:myplugin:post-goal"
> > >
> > > I'd like to provide in my corporate POM some "macro command" to define
> > > custom goals / lifecycle phases to run such commands.
> > >
> > > example : "mvn release" to create the release.
> > >
> > > Is there any way to create such macro-commands with maven, when the
> > > standard lifecycle is not enough ? I don't thing so, but maybe some
> > > combination of profiles and invoker plugin could help ?
> > >
> > > Nico.
> >
> >
> >
> > --
> > Michael McCallum
> > Enterprise Engineer
> > mailto:gholam@apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: any maven support for "macros" ?

Posted by nicolas de loof <ni...@apache.org>.
The assembly plugin requires the package goal to be run prior (to get acces
to modules). mvn assembly:assembly fails with "xx-ear project has no file" !
-> mvn package assembly:attached (as described in plugin doc)

My project has some modules that builds maven plugins, used on other
modules, so install is required
-> mvn install assembly:attached

Next, my custom plugin works on the tar.gz produced by the assembly, so must
run next
-> mvn install assembly:attached com.mycompany:myplugin:custom-goal

I could force an @execute goal=assembly:assembly in my custom plugin, but
still nedd to run package before the assembly to work.


2008/1/8, Michael McCallum <gh...@apache.org>:
>
> why are you trying to 'release' with the install plugin?
>
> you should use the release plugin and bind the assembly and custom plugin
> to a
> phase of the project lifecycle, its all very well documented all over the
> place....
>
> <plugin>
> <artifactId>maven-assembly-plugin</artifactId>
> <version>2.2-beta-1</version>
> <executions>
> <execution>
>   <phase>package</phase>
>   <goals>
>    <goal>attached</goal>
>   </goals>
>   <configuration>
>    <descriptors>
>     <descriptor>src/main/assembly/aggregation.xml</descriptor>
>    </descriptors>
>    <outputDirectory>target/assembly</outputDirectory>
>    <workDirectory>target/assembly/work</workDirectory>
>   </configuration>
> </execution>
> </executions>
> </plugin>
>
> On Wed, 09 Jan 2008 09:19:44 nicolas de loof wrote:
> > Hello,
> >
> > To release my project I need to call a rather complex maven command :
> > "mvn install assembly:attached com.mycompany:myplugin:post-goal"
> >
> > I'd like to provide in my corporate POM some "macro command" to define
> > custom goals / lifecycle phases to run such commands.
> >
> > example : "mvn release" to create the release.
> >
> > Is there any way to create such macro-commands with maven, when the
> > standard lifecycle is not enough ? I don't thing so, but maybe some
> > combination of profiles and invoker plugin could help ?
> >
> > Nico.
>
>
>
> --
> Michael McCallum
> Enterprise Engineer
> mailto:gholam@apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: any maven support for "macros" ?

Posted by Michael McCallum <gh...@apache.org>.
why are you trying to 'release' with the install plugin?

you should use the release plugin and bind the assembly and custom plugin to a 
phase of the project lifecycle, its all very well documented all over the 
place.... 

<plugin>
 <artifactId>maven-assembly-plugin</artifactId>
 <version>2.2-beta-1</version>
 <executions>
  <execution>
   <phase>package</phase>
   <goals>
    <goal>attached</goal>
   </goals>
   <configuration>
    <descriptors>
     <descriptor>src/main/assembly/aggregation.xml</descriptor>
    </descriptors>
    <outputDirectory>target/assembly</outputDirectory>
    <workDirectory>target/assembly/work</workDirectory>
   </configuration>
  </execution>
 </executions>
</plugin>

On Wed, 09 Jan 2008 09:19:44 nicolas de loof wrote:
> Hello,
>
> To release my project I need to call a rather complex maven command :
> "mvn install assembly:attached com.mycompany:myplugin:post-goal"
>
> I'd like to provide in my corporate POM some "macro command" to define
> custom goals / lifecycle phases to run such commands.
>
> example : "mvn release" to create the release.
>
> Is there any way to create such macro-commands with maven, when the
> standard lifecycle is not enough ? I don't thing so, but maybe some
> combination of profiles and invoker plugin could help ?
>
> Nico.



-- 
Michael McCallum
Enterprise Engineer
mailto:gholam@apache.org

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


Re: any maven support for "macros" ?

Posted by Michael McCallum <gh...@apache.org>.
> To release my project I need to call a rather complex maven command :
> "mvn install assembly:attached com.mycompany:myplugin:post-goal"
if you need to just run custom plugin during a release you could bind it to 
the verify phase and define in a profile activated by the 
property 'performRelease'

-- 
Michael McCallum
Enterprise Engineer
mailto:gholam@apache.org

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


Re: any maven support for "macros" ?

Posted by Wayne Fay <wa...@gmail.com>.
I've seen other people doing this by creating their own batch/shell
scripts in the project directory eg mvn-release.bat and
mvn-release.sh.

We actually used to do this with Ant since we could never remember the
various targets we wanted.

Wayne

On 1/8/08, nicolas de loof <ni...@apache.org> wrote:
> Hello,
>
> To release my project I need to call a rather complex maven command :
> "mvn install assembly:attached com.mycompany:myplugin:post-goal"
>
> I'd like to provide in my corporate POM some "macro command" to define
> custom goals / lifecycle phases to run such commands.
>
> example : "mvn release" to create the release.
>
> Is there any way to create such macro-commands with maven, when the standard
> lifecycle is not enough ? I don't thing so, but maybe some combination of
> profiles and invoker plugin could help ?
>
> Nico.
>

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