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 <args> -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

相关推荐
码界奇点11 分钟前
基于Spring Boot的内容管理系统框架设计与实现
java·spring boot·后端·车载系统·毕业设计·源代码管理
墨雪不会编程36 分钟前
C++【string篇1遍历方式】:从零开始到熟悉使用string类
java·开发语言·c++
蒂法就是我1 小时前
有一张表,只有一个字段没有插入主建,能插入成功吗? 隐藏的 rowid除了在这里用到还在哪里用到了?
java
a努力。1 小时前
字节Java面试被问:系统限流的实现方式
java·开发语言·后端·面试·职场和发展·golang
独自破碎E1 小时前
Java中的Exception和Error有什么区别?
java·开发语言
小徐Chao努力1 小时前
【Langchain4j-Java AI开发】08-向量嵌入与向量数据库
java·数据库·人工智能
qq_377112371 小时前
从零开始深入理解并发、线程与等待通知机制
java·开发语言
小徐Chao努力1 小时前
【Langchain4j-Java AI开发】07-RAG 检索增强生成
java·人工智能·python
JoannaJuanCV1 小时前
自动驾驶—CARLA仿真(30)交通管理器(Traffic Manager)
java·redis·自动驾驶
Knight_AL2 小时前
Spring AOP 中 JoinPoint 使用指南
java·python·spring