I want to use sql scripts in my webapp which I am building using maven 2.
However, the scripts are executed when I run mvn package command. I want
these scripts to be executed when I deploy the app on geronimo.

 

Any help is appreciated.

 

Regards,

 

Vinita

 

 

I have added the following in my pom.xml

 

<plugins>

            <plugin>

 

        <groupId>org.codehaus.mojo</groupId>

        <artifactId>sql-maven-plugin</artifactId>

 

        <dependencies>

          <!-- specify the dependent jdbc driver here -->

          <dependency>

            <groupId>ojdbc14</groupId>

            <artifactId>ojdbc14</artifactId>

            <version>10.1.0.4.0</version>

          </dependency>

        </dependencies>

 

        <!-- common configuration shared by all executions -->

        <configuration>

           <username>sf</username>

           <password>sf</password>

           <!-- You can comment out username/password configurations and 

                have maven to look them up in your settings.xml using
${settingsKey}

           -->

           <settingsKeys>sensibleKey</settingsKeys>

           <driver>oracle.jdbc.driver.OracleDriver</driver>

           <url>jdbc:oracle:thin:@localhost:1521:orcl</url>

        </configuration>

 

        <executions>

 

          

          <execution>

            <id>create-data</id>

            <phase>process-test-resources</phase>

            <goals>

              <goal>execute</goal>

            </goals>

            <configuration>

              <fileset>

                <basedir>src</basedir>

                <includes>

                  <!-- These 2 files may not get executed in sequence, use
srcFiles instead, if needed -->

                  <include>test/sql/test-data.sql</include>

                  <!--<include>test/sql/test-data2.sql</include>-->

                </includes>

              </fileset>

            </configuration>

          </execution>

 

          

        </executions>

            </plugin>

            </plugins>

Reply via email to