maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hanuman <hanumannallap...@gmail.com>
Subject Conditionally executing a script in profile
Date Thu, 24 Jul 2014 17:02:17 GMT
Hi All,

I am trying to execute a particular sql script conditionally in a
profile(POM.XML).

Example: assume I had a following profile in a POM.xml
if I run "mvn -Pload-test-data -e
it's executing all scripts mentioned in SrcFiles tag.

But I am trying to execute "script3.sql" only when a particular flag is
passed as 'y'

i.e..,I am looking for a command like
mvn -Pload-test-data -e -Dref_flag='y' 
then only execute script3.sql otherwise not. 

Could you please assist me how we can do that?
Thanks very much for regardin my query.

Profile in my POM.xml::

        <profile>
            <id>load-test-data</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.voca.maven.plugins</groupId>
                        <artifactId>maven-database-util-plugin</artifactId>
                        <version>0.9</version>
                        <executions>
                            <execution>
                <id>load-test-data</id>
                                <goals>
                                    <goal>execute</goal>
                                </goals>
                                <configuration>
                                    <settingsKey>fps-fpsedw-db</settingsKey>
                                    <srcFiles>
										<srcFile>util/script1.sql</srcFile>
										<srcFile>util/script2.sql</srcFile>
										<srcFile>util/script3.sql</srcFile>
                                    </srcFiles>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>



--
View this message in context: http://maven.40175.n5.nabble.com/Conditionally-executing-a-script-in-profile-tp5800947.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Mime
View raw message