how to skip an execution for sql-maven-plugin -- a defect ?

32 views
Skip to first unread message

Samarjit Adhikari

unread,
Apr 14, 2017, 9:19:45 PM4/14/17
to mojohaus-dev
Hello All,

I have following pom. If "skip" property is made true in each <execution> tag , it does not seems to be worked, where as  if it is made in top level <configuration> tags, it is working to skip all <executions> tags. 
My requirement is to skip each <execution> tag conditionally which will be passed as environment variable. Such behavior looks to be a defect. Could you please confirm ?
--------------------------------------
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId>
        <version>1.6</version>

<dependencies>
<dependency>
   <groupId>com.oracle</groupId>
        <artifactId>ojdbc6</artifactId>
        <version>${oracle.version}</version>
</dependency>
                <dependency>
                    <groupId>postgresql</groupId>
                    <artifactId>postgresql</artifactId>
                    <version>${postgresql.version}</version>
                </dependency>
       </dependencies>

    <!-- common configuration shared by all executions -->
<configuration>
                   <!-- <skip>true</skip>  This works --> 
</configuration>

<executions>
   <execution>
   <id>run command for oracle</id>
        <phase>pre-integration-test</phase>
    <goals>
       <goal>execute</goal>
    </goals>
        <configuration>
                               <skip>true</skip>  <!-- Does not work -->
    <username>xyz</username>
    <password>xyz</password>
    <url>abcd</url>
                                <driver>oracle.jdbc.driver.OracleDriver</driver>
    <autocommit>true</autocommit>
                                <sqlCommand>...</sqlCommand>
                                <onError>continue</onError>
        </configuration>
   </execution>

   <execution>
   <id>run command for postgres</id>
          <phase>pre-integration-test</phase>
    <goals>
       <goal>execute</goal>
    </goals>
    <configuration>
                               <skip>true</skip> <!-- Does not work -->
    <username>xyz</username>
    <password>xyz</password>
    <url>abcd</url>
                                <driver>org.postgresql.Driver</driver>
    <autocommit>true</autocommit>
                               <sqlCommand>...</sqlCommand>
                               <onError>continue</onError>
          </configuration>
   </execution>
</executions>
</plugin>
--------------------------------------------

With regards,
Samarjit

Karl Heinz Marbaise

unread,
May 27, 2017, 3:11:41 PM5/27/17
to mojohaus-dev
Hi,

can you make an example test project on github so I can take a look at it...
Reply all
Reply to author
Forward
0 new messages