maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernd Eckenfels <>
Subject AW: Conditionally executing a script in profile
Date Thu, 24 Jul 2014 17:10:02 GMT
There are two typical things done - you either use two profiles or you use a plugin which supports
a skip property.

 other ways are hard to understand (like adding a property to the include pattern to make
it not find the resource) and should be avoided.

i dont know if your particular mentioned DB Plugin supports more configuration.


----- Ursprüngliche Nachricht -----
Von: "hanuman" <>
Gesendet: ‎24.‎07.‎2014 19:02
An: "" <>
Betreff: Conditionally executing a script in profile

Hi All,

I am trying to execute a particular sql script conditionally in a

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::


View this message in context:
Sent from the Maven - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message