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 Server 字符串到日期的转换 2021-01-01
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- SQL Server 2016更改对象所有者 2022-01-01
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01