views:

311

answers:

2

I am using eclipse with the maven 2 plugin.

I want to add the dependency for sqljdbc4, how can I do that?

Can't seem to find it via the 'add dependency' option in eclipse?

A: 

Use the maven-eclipse-plugin to generate your .classpath and .project and all will be well.

Failing that, you have to find the jar in your ~/.m2/repository and add it as an external library.

bmargulies
+2  A: 

If sqljdbc4 is the Microsoft SQL Server JDBC Driver, then you will very likely not find it in any "public" repository because of licensing issues.

So you'll have to download it, unpack it and install it manually with either mvn install:install-file (or mvn deploy:deploy-file if you have a repository manager).

Another option would be to use jTDS (which is open source and available in maven central repository) if your database engine is supported.

Pascal Thivent