Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

skip an execution for sql-maven-plugin conditionally #18

Open
mr-samarjit-adhikari opened this issue Apr 15, 2017 · 1 comment
Open

Comments

@mr-samarjit-adhikari
Copy link

mr-samarjit-adhikari commented Apr 15, 2017

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

org.codehaus.mojo sql-maven-plugin 1.6
<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>
--------------------------------------------

With regards,
Samarjit

@khmarbaise
Copy link
Member

Do you have a full working example which shows what might wrong or not...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants