> -----Oorspronkelijk bericht-----
> Van: Roel van Dijk [mailto:[EMAIL PROTECTED]
> Verzonden: Tuesday, March 15, 2005 2:03 PM
> Aan: Jetspeed Users List
> Onderwerp: importing PSML into the database - where do I put the driver?
>
>
> So here is the big question: where should I put the MySQL-Driver
> JAR file so that the combination of Maven and Torque can find it?

[note: I'm using 1.6-dev from CVS]

I asked this question yesterday, but got no reply. I've been working on it
all day yesterday, but couldn't find it. A new day, a new insight. Here is
the solution to my problem.

Since the PsmlImporter and related classes couldn't find the JDBC driver, I
edited the PsmlImporter source file to print out the classpath it was using.
Apparently it was looking in the ~/.maven/repository/ directory for all the
JAR files. Looking around a bit in the Jetspeed source root directory, those
directories were mentioned in a couple of files. First, in the ".classpath"
file, and next in the "project.xml" file (and those included there from the
./etc/project-dependencies/ directory). First, I put the MySQL JDBC JAR file
in my maven repository. Then I tried editing the .classpath file, which
didn't help. Finally I added another file to the project-dependencies
directory and included it in project.xml. Success!

So here's what I did:

1. Add the driver JAR to your Maven repository. I made a subdir
~/.maven/repository/mysql/jars/ and copied the
mysql-connector-java-3.1.7-bin.jar there.

2. Make a mysql.xml in ./etc/project-dependencies/, containing this:

<!--MySQL dependencies-->
    <dependency>
        <id>mysql:mysql-connector-java</id>
        <version>3.1.7-bin</version>
        <properties>
            <war.bundle>true</war.bundle>
        </properties>
    </dependency>

3. Import this mysql.xml in the project.xml file by adding this line at the
start of the <dependencies> section:
    &mysql;

4. Rebuild.

5. the 'maven import' command now works.

I guess the same procedure works for other database drivers.

Roel van Dijk
Forest & Fields






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

Reply via email to