How are you deploying the app to a geronimo instance (Cargo Maven plugin?)

You can use a <profile> and nest your plugin's configuration therein and invoke the profile using '-P <profileName>' when you want to invoke the deploy goal (I am assuming you are using Cargo for deployment).

HTH,
Rahul



Vinita Joshi wrote:
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>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to