You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Boris Janvier <bo...@vehco.com> on 2012/05/30 10:46:03 UTC

org.codehaus.mojo sql-maven-plugin v1.5

Hello, I have a problem with this plugin,


I configure it like this :
                                                        <plugin>
                                                               <groupId>org.codehaus.mojo</groupId>
                                                               <artifactId>sql-maven-plugin</artifactId>
                                                               <version>1.5</version>
                                                               <dependencies>
                                                                              <!-- specify the dependent JDBC driver here -->
                                                                              <dependency>
                                                                                              <groupId>net.sourceforge.jtds</groupId>
                                                                                              <artifactId>jtds</artifactId>
                                                                                              <version>1.2.2</version>
                                                                              </dependency>
                                                               </dependencies>

                                                               <!-- common configuration shared by all executions -->
                                                               <configuration>
                                                                              <driver>net.sourceforge.jtds.jdbc.Driver</driver>
                                                                              <url>jdbc:jtds:sqlserver://localhost:1433/Test;instance=SQL2008R2</url>
                                                                              <username>admin</username>
                                                                              <password>admin</password>
                                                               </configuration>

                                                               <executions>
                                                                              <execution>
                                                                                              <phase>package</phase>
                                                                                              <goals>
                                                                                                              <goal>execute</goal>
                                                                                              </goals>
                                                                                              <!-- specific configuration for this execution -->
                                                                                              <configuration>
                                                                                                              <!-- specify your SQL commands, can be all of the following configurations -->
<srcFiles>                                                                                                                                                                                                      <srcFile>src/main/resources/working/Restauration.sql</srcFile>
                                                                                                              </srcFiles>
                                                                                              </configuration>
                                                                              </execution>
                                                               </executions>
                                               </plugin>

And I have the error message :

Error message :
[ERROR] Failed to execute goal org.codehaus.mojo:sql-maven-plugin:1.5:execute (default) on project RestaureCube: Incorre
ct syntax near 'GO'. -> [Help 1]

additional information :
-I test with version 1.5
-sql serveur 2008R2 on my local post (the script work well when i use sqlmanager to run it)
-Maven 3.0.3
-winXP 32bits


I do simple test and with the script


my script :
USE [master]

result :
[DEBUG] 0 rows affected
[DEBUG] Committing transaction
[INFO] 1 of 1 SQL statements executed successfully
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.704s
[INFO] Finished at: Wed May 30 09:41:42 CEST 2012
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------

my script :
USE [master]
GO

result :
[DEBUG] SQL: USE [master]
GO

[ERROR] Failed to execute: USE [master]
GO

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.078s
[INFO] Finished at: Wed May 30 09:45:04 CEST 2012
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sql-maven-plugin:1.5:execute (default) on project RestaureCube: Incorre
ct syntax near 'GO'. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sql-maven-plugin:1.5:ex
ecute (default) on project RestaureCube: Incorrect syntax near 'GO'.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[...]
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException



I ask on codehaus.org and they said me to ask here, they thinks A miss a configuration



Thank you for your help



Boris Janvier

[Description : VEHCO_cmjn_70x26_300dpi]
ELOsystèmes SAS (groupe Vehco)
Z.A. Loascoat - 23 Rue Nicéphore Niepce
29200 Brest, France
www.elomobile.com<http://www.elomobile.com/>


Re: org.codehaus.mojo sql-maven-plugin v1.5

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi,

i would check the delimiter between the statements...that might cause 
the problem which is usually ";" which might be wrong in this case...

Kind regards
Karl-Heinz Marbaise
-- 
SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
Dipl.Ing.(FH) Karl-Heinz Marbaise        ICQ#: 135949029
Hauptstrasse 177                         USt.IdNr: DE191347579
52146 Würselen                           http://www.soebes.de

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org