Hi,
And table is a reserved word in sql, so you should insert your real
table name there.
Yes of course i know...in the real example here i have a real table
name, but i don't want to write real names in the post into the mailing
list...
Kind regards
Karl Heinz Marbaise
-ketil
On Thu, Apr 23, 2009 at 10:47 AM, Karl Heinz Marbaise <khmarba...@gmx.de> wrote:
Hi there,
I have a large multi module project which is working well.
Now i'm trying to enhance this with a things which is in relationship with
the database...
Ok i decided to take a look at the sql-maven-plugin to execute some SQL
statements before an integration test is run (simply delete the contents of
the databases as a first step)...
But no i ran into the following problem:
I have taken the configuration of the plugin from the examples page:
http://mojo.codehaus.org/sql-maven-plugin/examples/execute.html
I'm using Maven 2.0.10 (tested the problem with 2.0.9 with the same result).
Here is the snipped from the POM.xml file:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId>
<version>1.3</version>
<dependencies>
<dependency>
<groupId>${database.pom.groupId}</groupId>
<artifactId>${database.pom.artifactId}</artifactId>
<version>${database.pom.version}</version>
</dependency>
</dependencies>
<configuration>
<driver>${database.driverClassName}</driver>
<url>${database.url}</url>
<username>${database.username}</username>
<password>${database.password}</password>
</configuration>
<executions>
<execution>
<id>drop-db-before-test-if-any</id>
<phase>process-test-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<sqlCommand>SELECT *FROM table</sqlCommand>
</configuration>
</execution>
</executions>
</plugin>
May be i'm completely blind and oversight things...
The following is printed out:
C:\DEV\workspace\.....\it>mvn clean integration-test
Using User setting from T:/System/.m2/settings.xml
Using Memory settings: -Xms256m -Xmx1024m
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[INFO] Building XXX XXXXXXXXX :: Integration Test
[INFO] task-segment: [clean, integration-test]
[INFO]
------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting file-set: C:\DEV\workspace\.... (included: [], excluded: [])
[INFO] [cobertura:clean {execution: clean}]
[INFO] [antrun:run {execution: default}]
[INFO] Executed tasks
[INFO] [sql:execute {execution: drop-db-before-test-if-any}]
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Ung³ltige Argumente in Aufruf
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Thu Apr 23 10:29:18 CEST 2009
[INFO] Final Memory: 19M/254M
[INFO]
------------------------------------------------------------------------
So i have called Maven with -X
[DEBUG] Configuring mojo 'org.codehaus.mojo:sql-maven-plugin:1.3:execute'
-->
[DEBUG] (f) autocommit = false
[DEBUG] (s) delimiter = ;
[DEBUG] (s) delimiterType = normal
[DEBUG] (s) driver = oracle.jdbc.driver.OracleDriver
[DEBUG] (s) keepFormat = false
[DEBUG] (s) onError = abort
[DEBUG] (s) password = XXXXXXXXX
[DEBUG] (f) settings = org.apache.maven.settings.setti...@7b1641
[DEBUG] (f) skip = false
[DEBUG] (f) skipOnConnectionError = false
[DEBUG] (s) sqlCommand = SELECT *FROM XXXXXXXXXXXXXX
[DEBUG] (s) url = jdbc:oracle:thin:@DATABASESIDXXXXX
[DEBUG] -- end configuration --
[INFO] [sql:execute {execution: drop-db-before-test-if-any}]
[DEBUG] connecting to jdbc:oracle:thin:@DATABASIDXXXXX
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Ung³ltige Argumente in Aufruf
[INFO]
------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Ung³ltige Argumente
in Aufruf
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:584)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:500)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:479)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:331)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:292)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:301)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Ung³ltige
Argumente in Aufruf
at org.codehaus.mojo.sql.SqlExecMojo.execute(SqlExecMojo.java:434)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:453)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
... 16 more
Caused by: java.sql.SQLException: Ung³ltige Argumente in Aufruf
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:236)
at
oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:420)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at
org.codehaus.mojo.sql.SqlExecMojo.getConnection(SqlExecMojo.java:670)
at org.codehaus.mojo.sql.SqlExecMojo.execute(SqlExecMojo.java:428)
... 18 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 7 seconds
[INFO] Finished at: Thu Apr 23 10:27:46 CEST 2009
[INFO] Final Memory: 19M/254M
[INFO]
------------------------------------------------------------------------
Does anyone a hint ?
Many thanks in advance...
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-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org
--
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-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org