Hmmm. Did you try putting something like this in your POM?
      ...
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>print-hello</id>
            <phase>clean</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>echo</executable>
              <arguments>
                <argument>hello</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>print-goodbye</id>
            <phase>clean</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>echo</executable>
              <arguments>
                <argument>goodbye</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      ...

This prints hello and goodbye as part of the clean phase.  All I had to
do was issue the following mvn command:

mvn clean

and it printed both hello and goodbye by executing two commands at the
command line. You can of course bind something like this to any phase
you like.

Doesn't this fit your needs?

---
Todd Thiessen
 

> -----Original Message-----
> From: Trevor Harmon [mailto:tre...@vocaro.com] 
> Sent: Tuesday, December 16, 2008 6:02 PM
> To: Maven Users List
> Subject: Re: Are Maven profiles like Ant targets?
> 
> On Dec 16, 2008, at 5:24 PM, Todd Thiessen wrote:
> 
> > I believe there is. Plugin can have different executions. There is 
> > some documentation about that here:
> >
> > 
> http://maven.apache.org/guides/introduction/introduction-to-the-lifecy
> > cl
> > e.html#Plugins
> 
> But that doesn't work for the exec plugin. I'd be grateful if 
> someone could prove me wrong.
> 
> > and I believe the definitive guide has some examples too.
> 
> No, in the book they always pass the exec arguments on the 
> command line. See:
> 
> http://books.sonatype.com/maven-book/reference/customizing.htm
> l#section-custom-exec
> 
> > But you still would have to bind it to a phase, which you 
> don't want 
> > to do.
> 
> I'm not trying to avoid anything. If binding to a phase would 
> solve the problems, then I'd do it. But simply binding a 
> plugin to a phase is not enough, for reasons I have shown.
> 
> > So I agree with you that Maven is definitely heavy weight 
> if all you 
> > wish to do is execute an exe with different parameters each time.
> > It doesn't do this nicely. You probably just want a simple 
> script for 
> > that.
> 
> Or I could just use profiles.
> 
> Trevor
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
> 
> 

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

Reply via email to