Hi Brice,
I had the same problem. After much faffing around (I'm a Maven newbie) I
managed to get it to work. I did 2 things:

1. Just before each goal I put a <phase> tag in. So for your first goal:

                <goals>
                  <goal>execute</goal>
                </goals> 

this became:
                <phase>process-test-resources</phase>
                <goals>
                  <goal>execute</goal>
                </goals> 

You would need to do this with the other goals as well. 

2. When I ran the project, the command line I used was: mvn sql:execute test

This then ran the SQL.
BTW, I just used the srcFiles parameter.

Hope this helps.

ady



Brice Lambi-3 wrote:
> 
> Hello,
>       I'm trying to use the sql-maven-plugin with maven2 and I'm having
> trouble getting it to execute the configuration.  I'm using the command
> 'mvn sql:execute' with the following pom.  The output is "0 of 0 SQL
> Statements executed successfully".  It does the same thing with
> <sqlCommand> instead of <srcFiles>.  What am I missing?
> 
>  <plugin>
>         <groupId>org.codehaus.mojo</groupId>
>         <artifactId>sql-maven-plugin</artifactId>
>         <dependencies>
>           <dependency>
>                 <groupId>jdbc</groupId>
>                 <artifactId>oracle</artifactId>
>                 <version>1.4</version>
>           </dependency>
>         </dependencies>
>         <configuration>
>           <username>smcs</username>
>           <password>bogus</password>
>           <driver>oracle.jdbc.driver.OracleDriver</driver>
>           <url>jdbc:oracle:thin:@localhost:1521:XE</url>
>         </configuration>
>         <executions>
>           <execution>
>                 <id>drop-db</id>
>                 <goals>
>                   <goal>execute</goal>
>                 </goals>
>                 <configuration>
>                         <sqlCommand>drop table status</sqlCommand>
>                         <srcFiles>
> <srcFile>src/main/resource/sql/oracle/drop.sql</srcFile>
>                         </srcFiles>
>                         <onError>continue</onError>
>                 </configuration>
>           </execution>
>           <execution>
>                 <id>create-db</id>
>                 <goals>
>                   <goal>execute</goal>
>                 </goals>
>                 <configuration>
>                         <srcFiles>
> <srcFile>src/main/resource/sql/oracle/create.sql</srcFile>
>                         </srcFiles>
>                 </configuration>
>           </execution>
>         </executions>
>       </plugin>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/sql-maven-plugin-not-executing-srcFiles-tf2603085.html#a9005324
Sent from the mojo - user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to