You have to state the dependency in the plugin, not in the pom itself. Like this (replacing the variables ${...} by the actual values):

      <plugin>
        <groupId>org.apache.db.torque</groupId>
        <artifactId>torque-maven-plugin</artifactId>
        <configuration>
          ...
        </configuration>
        <executions>
          ....
        </executions>
        <dependencies>
          <dependency>
            <artifactId>${torque.test.driver.artifactId}</artifactId>
            <groupId>${torque.test.driver.groupId}</groupId>
            <version>${torque.test.driver.version}</version>
          </dependency>
        </dependencies>
      </plugin>


On Tue, 12 Dec 2006, loic.queran wrote:

How is the JDBC driver loaded when executing torque:sqlExec with maven2 and Torque 3.3-RC1 maven2 plugin ? Even when I add a dependency on the driver in the POM, maven2 complains that it can't be found.

Any help will be appreciated.

Loïc



[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'torque'.
[INFO] ----------------------------------------------------------------------------
[INFO] Building myapp
[INFO]    task-segment: [torque:sqlExec]
[INFO] ----------------------------------------------------------------------------
[INFO] [torque:sqlExec]
[INFO] SQL src dir: target/sql
Our new url -> jdbc:mysql://myserver:3306/myapp
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Class Not Found: JDBC driver com.mysql.jdbc.Driver could not be loaded
[INFO] ------------------------------------------------------------------------
[INFO] Trace
Class Not Found: JDBC driver com.mysql.jdbc.Driver could not be loaded
at org.apache.torque.task.TorqueSQLExec.insertDatabaseSqlFiles(TorqueSQLExec.java:523) at org.apache.torque.task.TorqueSQLExec.execute(TorqueSQLExec.java:482)
      at org.apache.torque.mojo.SqlExecMojo.execute(SqlExecMojo.java:323)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:488) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:458) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
      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)
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12 seconds
[INFO] Finished at: Tue Dec 12 22:01:19 CET 2006
[INFO] Final Memory: 4M/8M
[INFO] ------------------------------------------------------------------------


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


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

Reply via email to