You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Tawfik, Sameh E" <Sa...@fairisaac.com> on 2008/05/03 02:20:13 UTC

How to instruct Maven to run more than one script?

Hi,

I've two Perl scripts, "Before_Build.pl", and "After_Build.pl " that I
need to run the first one before the build starts and the other one
after the build is complete.

So, what is the command line syntax to run a full build with the above
requirements?

I've the following code in my pom.xml:

             <plugin>
               <groupId>org.codehaus.mojo</groupId>
               <artifactId>exec-maven-plugin</artifactId>
               <executions>
                 <execution>
                   <goals>
                     <goal>exec</goal>
                   </goals>
                 </execution>
               </executions>
               <inherited>false</inherited>
               <configuration>
                 <executable>Before_Build.pl</executable>
                 <arguments>
                   <argument>20</argument>
                 </arguments>
               </configuration>
             </plugin>

             <plugin>
               <groupId>org.codehaus.mojo</groupId>
               <artifactId>exec-maven-plugin</artifactId>
               <executions>
                 <execution>
                   <goals>
                     <goal>exec</goal>
                   </goals>
                 </execution>
               </executions>
               <inherited>false</inherited>
               <configuration>
                 <executable>After_Build.pl</executable>
                 <arguments>
                   <argument>20</argument>
                 </arguments>
               </configuration>
             </plugin>

I can successfully execute the first Perl script "Before_Build.pl" from
the command line, by running the following command:
  
  C:\projects>mvn -N exec:exec -Dexec.executable=" Before_Build.pl"


   Thanks,

     Sameh
This email and any files transmitted with it are confidential, proprietary
and intended solely for the individual or entity to whom they are addressed.
If you have received this email in error please delete it immediately.


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


Re: How to instruct Maven to run more than one script?

Posted by Jerome Lacoste <je...@gmail.com>.
On Sat, May 3, 2008 at 2:20 AM, Tawfik, Sameh E
<Sa...@fairisaac.com> wrote:
>
> Hi,
>
> I've two Perl scripts, "Before_Build.pl", and "After_Build.pl " that I
> need to run the first one before the build starts and the other one
> after the build is complete.
>
> So, what is the command line syntax to run a full build with the above
> requirements?

Extract from the soon to be published FAQ of the exec mojo:

Q: How to execute the plugin multiple times ?

    Use several execution nodes each with a different id. Don't forget
to bind each execution to a phase.

    Read the full answer here:
http://article.gmane.org/gmane.comp.java.maven-plugins.mojo.user/1307




> I've the following code in my pom.xml:
>
>             <plugin>
>               <groupId>org.codehaus.mojo</groupId>
>               <artifactId>exec-maven-plugin</artifactId>
>               <executions>
>                 <execution>
>                   <goals>
>                     <goal>exec</goal>
>                   </goals>
>                 </execution>
>               </executions>
>               <inherited>false</inherited>
>               <configuration>
>                 <executable>Before_Build.pl</executable>
>                 <arguments>
>                   <argument>20</argument>
>                 </arguments>
>               </configuration>
>             </plugin>
>
>             <plugin>
>               <groupId>org.codehaus.mojo</groupId>
>               <artifactId>exec-maven-plugin</artifactId>
>               <executions>
>                 <execution>
>                   <goals>
>                     <goal>exec</goal>
>                   </goals>
>                 </execution>
>               </executions>
>               <inherited>false</inherited>
>               <configuration>
>                 <executable>After_Build.pl</executable>
>                 <arguments>
>                   <argument>20</argument>
>                 </arguments>
>               </configuration>
>             </plugin>
>
> I can successfully execute the first Perl script "Before_Build.pl" from
> the command line, by running the following command:
>
>  C:\projects>mvn -N exec:exec -Dexec.executable=" Before_Build.pl"
>
>
>   Thanks,
>
>     Sameh
> This email and any files transmitted with it are confidential, proprietary
> and intended solely for the individual or entity to whom they are addressed.
> If you have received this email in error please delete it immediately.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>



-- 
Jerome Lacoste, +47 40867729, Daglig Leder, CoffeeBreaks AS

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