executing a script from maven inside a multi module project
        Posted  
        
            by Roman
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Roman
        
        
        
        Published on 2010-03-28T12:36:20Z
        Indexed on 
            2010/03/28
            12:43 UTC
        
        
        Read the original article
        Hit count: 401
        
maven-2
|multi-module
Hi everyone.
I have this multi-module project.
In the beginning of each build I would like to run some bat file.
So i did the following:
<profile>
            <id>deploy-db</id>
            <build>
                <plugins>
 <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.1.1</version>
        </plugin>
                </plugins>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>exec-maven-plugin</artifactId>
                            <version>1.1.1</version>
                            <executions>
                                <execution>
                                    <phase>validate</phase>
                                    <goals>
                                        <goal>exec</goal>
                                    </goals>
                                    <inherited>false</inherited>
                                </execution>
                            </executions>
                            <configuration>
                                <executable>../database/schemas/import_databases.bat</executable>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
when i run the mvn verify -Pdeploy-db from the root I get this script executed over and over again in each of my modules.
I want it to be executed only once, in the root module.
What is there that I am missing ?
Thanks
© Stack Overflow or respective owner