I dealt with this one too.  I had to take a step back.

Maven is great for building/compiling code, but it is not an platform for execution. My problem went away when I decided to use maven to package/build my projects and left sql/data migration programs/etc/ to ant scripts.

Just my 2 cents.


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