You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Karl Heinz Marbaise <kh...@gmx.de> on 2009/04/23 10:47:38 UTC

sql-maven-plugin execution problem with Integration-test

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.Settings@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-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: sql-maven-plugin execution problem with Integration-test

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

after a longer break i found the issue based on the suggestions of  You...

>>    <username>${database.username}</username>
it simply has to be changed into ${database.user} so it was simply not 
using the correct property....for the username...

I was a little bit confused based on the stack trace...;-(

Many thanks for the help...


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


Re: sql-maven-plugin execution problem with Integration-test

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi,
> Well, the exception raised is caused by an SQLException, and it seems
> to say that you have an illegal argument in your query if my german is
> not all wrong.
> 
> Caused by: java.sql.SQLException: Ungłltige Argumente in Aufruf
Correct...(Your knowledge of german is not wrong ;-))...


But now i simplified the thing more and using the following:

<sqlCommand>SELECT sysdate from dual;</sqlCommand>

and got the same result...

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


Re: sql-maven-plugin execution problem with Integration-test

Posted by Ketil Aasarød <ke...@gmail.com>.
Well, the exception raised is caused by an SQLException, and it seems
to say that you have an illegal argument in your query if my german is
not all wrong.

Caused by: java.sql.SQLException: Ungłltige Argumente in Aufruf

-ketil

On Thu, Apr 23, 2009 at 11:08 AM, Karl Heinz Marbaise <kh...@gmx.de> wrote:
> Hi,
>>
>> You are missing a space in your sql query after the *.
>
> I changed it..."SELECT * FROM table", but the reaction was the same and i
> excepted nothing else, cause the syntax does not require a space...
>
> On the other hand the problem seemed to more located into the area of the
> lifecycle cause the error message is giving me such a hint...
>
> But thanks for you response...
>
> Kind regards
> Karl Heinz Marbaise
>>
>> -ketil
>>
>> On Thu, Apr 23, 2009 at 10:47 AM, Karl Heinz Marbaise <kh...@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.Settings@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-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@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-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: sql-maven-plugin execution problem with Integration-test

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
Hi,
> You are missing a space in your sql query after the *.
I changed it..."SELECT * FROM table", but the reaction was the same and 
i excepted nothing else, cause the syntax does not require a space...

On the other hand the problem seemed to more located into the area of 
the lifecycle cause the error message is giving me such a hint...

But thanks for you response...

Kind regards
Karl Heinz Marbaise
> 
> -ketil
> 
> On Thu, Apr 23, 2009 at 10:47 AM, Karl Heinz Marbaise <kh...@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.Settings@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-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@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-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: sql-maven-plugin execution problem with Integration-test

Posted by Ketil Aasarød <ke...@gmail.com>.
You are missing a space in your sql query after the *.

-ketil

On Thu, Apr 23, 2009 at 10:47 AM, Karl Heinz Marbaise <kh...@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.Settings@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-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: sql-maven-plugin execution problem with Integration-test

Posted by Karl Heinz Marbaise <kh...@gmx.de>.
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 <kh...@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.Settings@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-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@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-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: sql-maven-plugin execution problem with Integration-test

Posted by Ketil Aasarød <ke...@gmail.com>.
And table is a reserved word in sql, so you should insert your real
table name there.

-ketil

On Thu, Apr 23, 2009 at 10:47 AM, Karl Heinz Marbaise <kh...@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.Settings@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-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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