缺少工件com.microsoft.sqlserver:sqljdbc4:jar:4.0 [英] Missing artifact com.microsoft.sqlserver:sqljdbc4:jar:4.0

查看:1177
本文介绍了缺少工件com.microsoft.sqlserver:sqljdbc4:jar:4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的POM.xml文件中添加MS SQL驱动程序依赖项,以下是该依赖项.

I am trying to add MS SQL driver dependency in my POM.xml file and the following is the dependency.

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

但是我得到了这个异常

缺少工件com.microsoft.sqlserver:sqljdbc4:jar:4.0

Missing artifact com.microsoft.sqlserver:sqljdbc4:jar:4.0

我真的不明白这个问题.

I really don't understand the issue.

推荐答案

更新

Microsoft现在在Maven Central中提供此工件.有关更多详细信息,请参见@nirmal的答案: https://stackoverflow.com/a/41149866/1570834

Microsoft now provide this artifact in maven central. See @nirmal's answer for further details: https://stackoverflow.com/a/41149866/1570834

原始答案

问题在于,Maven在任何已配置的

The issue is that Maven can't find this artifact in any of the configured maven repositories.

不幸的是,Microsoft并未通过任何Maven存储库提供此工件.您需要从 Microsoft网站下载jar,然后手动将其安装到本地Maven存储库中.

Unfortunately Microsoft doesn't make this artifact available via any maven repository. You need to download the jar from the Microsoft website, and then manually install it into your local maven repository.

您可以使用以下maven命令执行此操作:

You can do this with the following maven command:

mvn install:install-file -Dfile=sqljdbc4.jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0 -Dpackaging=jar

然后,下次在POM上运行maven时,将找到工件.

Then next time you run maven on your POM it will find the artifact.

这篇关于缺少工件com.microsoft.sqlserver:sqljdbc4:jar:4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆