This artifact is not loaded in Maven repositories online.
The solution is to download the Microsoft website library and add it to the < to the local maven repository, with the command:
mvn install:install-file -Dfile=sqljdbc4.jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0 -Dpackaging=jar
Source: Missing artifact com.microsoft.sqlserver: sqljdbc4: jar: 4.0
If you use Maven through the Eclipse plugin, you will not be able to use the command line, and you must use the Eclipse interface itself to install the library in your local repository. As the tip of @ BrunoCésar in the comments, do the following:
Right-click the project name, go to "Run As > Run Configurations ..."
Inthewindowthatopens,rightclickon"Maven Build" then select "New".
Fillinthe"Goals" field with the command:
install:install-file -Dfile=D:\sqljdbc4.jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0 -Dpackaging=jar
In the "-Dfile=" field, enter the full path of the file .jar
.
Whenrunningthecommand,ifallgoeswellyouwillseethemessage"BUILD SUCCESS":
Andpom.xmlwillnormallyacceptthedependencysqljdbc4
,andwillnolongershowtheerror: