Missing artifact com.microsoft.sqlserver:sqljdbc4:jar:4.0(缺少工件 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.
推荐答案
UPDATE
微软现在在 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在任何配置的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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:缺少工件 com.microsoft.sqlserver:sqljdbc4:jar:4.0
基础教程推荐
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- 在多列上分布任意行 2021-01-01
- oracle区分大小写的原因? 2021-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
