Problem
I can’t use Microsoft SQL Server JDBC driver in Java project while using maven.
Solution
- Download the Microsoft SQL Server JDBC driver from MSDN site
- Unzip the package
- Navigate in command prompt into the directory with unzipped files and execute the following command
mvn install:install-file -Dfile=sqljdbc4.jar -Dpackaging=jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0
- You should see BUILD SUCCESS message.
- Modify your pom.xml
<dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>sqljdbc4</artifactId> <version>4.0</version> </dependency>