Re: Options for specifying the classpath to find a database driver

2017-03-08 Thread Romain Manni-Bucau
Hi

I guess the choice belongs to you.

However note that until 7.0.4 using mvn: in a classpath is not
supported on UNIx (https://issues.apache.org/jira/browse/TOMEE-2019)

Another tip for maven syntax is you can set the repo inline: mvn:
http://repo1.maven.org/maven2/!junit:junit:4.12:jar



Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Blog
 | Github  |
LinkedIn  | JavaEE Factory


2017-03-09 1:28 GMT+01:00 KARR, DAVID :

> I'm running a small REST service in Tomcat.  It presently queries an
> Oracle db to get some data.  In the config on the server, I put the JDBC
> jar into the "lib" directory of the installation, so it can find it without
> any special classpath augmentation.
>
> However, in the server config within Eclipse, when I'm prototyping my
> changes, I specify a "classpath" property on the "Resource" with a "mvn:"
> prefix.  It doesn't make sense to me to manually copy the JDBC driver jar
> into the Tomcat instance running in Eclipse, so I reference it from my
> local Maven cache.
>
> However, it's sort of an accident that that works.  I'm actually building
> this particular application with Gradle, which does not write to the local
> Maven cache (although I can read from it).  I work on a related application
> that is built with Maven, that gets the same artifact, so this manages to
> work.
>
> I'm now changing the REST service to also query a mysql (maria) db.  I
> have the driver jar in our intranet maven repo, so the Gradle build can get
> it.  However, I don't have another Maven-built application using this to
> install it into the local Maven cache.  I suppose I could also use the
> "maven-dependency-plugin" on the command line to directly download the
> artifact, but I'm looking for other options for doing this "cleanly".
>
> After I do my Gradle build at least once, the driver jar will be available
> on my local disk in a couple of places (my build stores the driver jars in
> a subdir of "build" to make it easier to install them on the server), so I
> suppose I could make the "classpath" value be an absolute (perhaps
> workspace-relative) path.  Is that my only other semi-reasonable
> alternative?
>


Options for specifying the classpath to find a database driver

2017-03-08 Thread KARR, DAVID
I'm running a small REST service in Tomcat.  It presently queries an Oracle db 
to get some data.  In the config on the server, I put the JDBC jar into the 
"lib" directory of the installation, so it can find it without any special 
classpath augmentation.

However, in the server config within Eclipse, when I'm prototyping my changes, 
I specify a "classpath" property on the "Resource" with a "mvn:" prefix.  It 
doesn't make sense to me to manually copy the JDBC driver jar into the Tomcat 
instance running in Eclipse, so I reference it from my local Maven cache.

However, it's sort of an accident that that works.  I'm actually building this 
particular application with Gradle, which does not write to the local Maven 
cache (although I can read from it).  I work on a related application that is 
built with Maven, that gets the same artifact, so this manages to work.

I'm now changing the REST service to also query a mysql (maria) db.  I have the 
driver jar in our intranet maven repo, so the Gradle build can get it.  
However, I don't have another Maven-built application using this to install it 
into the local Maven cache.  I suppose I could also use the 
"maven-dependency-plugin" on the command line to directly download the 
artifact, but I'm looking for other options for doing this "cleanly".

After I do my Gradle build at least once, the driver jar will be available on 
my local disk in a couple of places (my build stores the driver jars in a 
subdir of "build" to make it easier to install them on the server), so I 
suppose I could make the "classpath" value be an absolute (perhaps 
workspace-relative) path.  Is that my only other semi-reasonable alternative?