maven 报错 Missing artifact com.microsoft.sqlserver:sqljdbc4:jar:jdk15:4.0:4.0

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了maven 报错 Missing artifact com.microsoft.sqlserver:sqljdbc4:jar:jdk15:4.0:4.0相关的知识,希望对你有一定的参考价值。

当maven pom.xml加入sqljdbc依赖如下时报错

<dependency>
        <groupId>com.microsoft.sqlserver</groupId>
        <artifactId>sqljdbc4</artifactId>
        <version>4.0</version>
        <classifier>jdk15:4.0</classifier>
    </dependency>

 

出现这个错误的根本原因是maven仓库并没有微软的SQL Server的JDBC包,解决的方法是自己下载sqljdbc的包,然后将包直接导入maven本地仓库中

1.下载sqljdbc4.jar

2.打开命令提示符,切换到jar文件目录

3.执行下面命令

mvn install:install-file -Dfile=sqljdbc4.jar -Dpackaging=jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0
 
You should see something similar to this:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install-file (default-cli) @ standalone-pom ---
[INFO] Installing /Users/claude/installers/JDBC/sqljdbc_4.0/enu/sqljdbc4.jar to /Users/claude/.m2/repository/com/microsoft/sqlserver/sqljdbc4/4.0/sqljdbc4-4.0.jar
[INFO] Installing /var/folders/c6/q1bdtq557kv54783p1g6cbsw0000gp/T/mvninstall1874482299687761721.pom to /Users/claude/.m2/repository/com/microsoft/sqlserver/sqljdbc4/4.0/sqljdbc4-4.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.208s
[INFO] Finished at: Tue Mar 13 14:07:31 EDT 2012
[INFO] Final Memory: 3M/81M
[INFO] ------------------------------------------------------------------------

 

以上是关于maven 报错 Missing artifact com.microsoft.sqlserver:sqljdbc4:jar:jdk15:4.0:4.0的主要内容,如果未能解决你的问题,请参考以下文章

maven中引入oracle驱动报错Missing artifact com.oracle:ojdbc14:jar

Maven引入Hadoop依赖报错:Missing artifact jdk.tools:jdk.tools:jar:1.6

Maven报错Missing artifact jdk.tools:jdk.tools:jar:1.7

maven 报错 Missing artifact net.sf.json-lib:json-lib:jar:2.1

Eclipse Maven 引入报错 Missing artifact com.sun:tools:jar 1.8.0

maven 报错 Missing artifact com.microsoft.sqlserver:sqljdbc4:jar:jdk15:4.0:4.0