db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brent Atkins" <Brent.Atk...@Pro-Sys.biz>
Subject RE: trouble with Maven, MySQL & jbdc - SOLVED
Date Wed, 18 Feb 2004 14:47:53 GMT
Hey!

I took Siegfried's advice and looked at the maven-torque plugin (thanks for the tip!) and
found the
problem.  In plugin.jelly in the create-db goal there is a call to an ant sql task (line 370).
 It
looks like this:

        <sql
          autocommit="true"
          driver="${torque.database.driver}"
          onerror="continue"
          password="${torque.database.password}"
          src="${torque.sql.dir}/create-db.sql"
          url="${torque.database.createUrl}"
          userid="${torque.database.user}">
          <classpath refid="torque-classpath"/>
        </sql>

For some reason, the maven version of this task doesn't recognize the classpath being passed
to it
in this manner.  All you need to do is change the code to this:

        <sql
          autocommit="true"
          driver="${torque.database.driver}"
          onerror="continue"
          password="${torque.database.password}"
          src="${torque.sql.dir}/create-db.sql"
          url="${torque.database.createUrl}"
          userid="${torque.database.user}"
          classpathref="torque-classpath"
        />

As long as you make a dependency for your jdbc driver in your own POM, you are done.  Up at
the top
of plugin.jelly it already loads your pom dependencies so nothing else needs to be changed.
Everything works great now.

I would submit this as a patch, but I don't really know how.  If anyone would care to submit
it for
me or just feels like educating me on how its done I would appreciate it.  Until then, enjoy!

I have not tested this on the current CVS version, but I have looked at it on the web and
the bug is
in that version too.  Since the change is so localized I can't imagine that it would break
anything,
but you may want to test it a bit more to be sure.


-----Original Message-----
From: Göschl,Siegfried [mailto:Siegfried.Goeschl@drei.com]
Sent: Monday, February 16, 2004 3:17 PM
To: Apache Torque Users List
Subject: RE: trouble with Maven, MySQL & jbdc


Hi Brent,

this might not encourage you but I never got the Torque plugin working. The reason of your
problem
is probably the maven class loader used by the Torque plugin which usually does not pull in
application dependencies during plugin execution. You should have a look at the plugin.jelly
of the
Torque plugin and might add your JDBC driver to 'torque-classpath' - in this case don't forget
it to
add your JDBC thingies to the project.xml of the Torque plugin.

Don't know if this solves the problem ... please post a success story if it works .... :-)

Cheers,

Siegfried Goeschl




---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message