Could not find artifact com.microsoft.sqlserver:sqljdbc4:jar:4.0 in central

  • 具体错误

    [ERROR] Failed to execute goal on project datalink-resource: Could not resolve dependencies for project com.leon.datalink:datalink-resource:jar:1.0.0: Could not find artifact com.microsoft.sqlserver:sqljdbc4:jar:4.0 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
    [ERROR]
    [ERROR] After correcting the problems, you can resume the build with the command
    [ERROR] mvn -rf :datalink-resource
    weiyu@ubuntu22:~/work/datalink$

  • 解决办法(推荐)

pom.xml

错误:

复制代码
<dependency>
    <groupId>com.microsoft.sqlserver</groupId>
    <artifactId>sqljdbc4</artifactId>
</dependency>

改成

复制代码
<dependency>
    <groupId>com.microsoft.sqlserver</groupId>
    <artifactId>mssql-jdbc</artifactId>
    <version>12.10.0.jre11</version>
    <scope>compile</scope>
</dependency>
  • 其他解决办法(有问题)

手动下载:

https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc

https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc/8.1.1.jre8

https://github.com/Microsoft/mssql-jdbc

相关推荐
山荷枝8 分钟前
04-框架--SpringBoot
java·spring boot·后端
linux修理工9 分钟前
内存占用 99% 且 Java 程序较多的优化建议
java·开发语言
weixin_4604435613 分钟前
企业考试系统如何对接OA、钉钉和企业微信?SSO单点登录、组织同步与权限一致性设计
java·开发语言·数据库
Sylvia33.15 分钟前
篮球数据API的技术架构与工程实践:基于火星数据WebSocket实时推送体系
java·python·websocket·网络协议·架构
Hi李耶30 分钟前
【LeetCode】15.三数之和
java·算法·leetcode
蔬菜_1 小时前
前端转全栈-day6(构造函数与继承)
java
程序员雷欧1 小时前
Java 反射深度解析:从原理到源码的全面剖析
java·开发语言·python
登登登__1 小时前
春秋招笔试题总结
java·开发语言
rannn_1111 小时前
【力扣hot100】链表专题|21、2、19、24、92、25
java·数据结构·算法·leetcode·链表·开发
Rabitebla2 小时前
C++11 新特性详解(一):列表初始化、initializer_list 与右值引用
java·开发语言·数据结构·c++·算法·leetcode·list