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


- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 更改自动增量起始编号? 2021-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- SQL 临时表问题 2022-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01