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

相关推荐
优雅的38度4 分钟前
SpringBoot 3.0+ 整合 Swagger 3.0
java·后端
Pitayafruit7 分钟前
🔥 Spring Boot 3 整合 zxing:轻松生成二维码的指南
java·spring boot·后端
雷渊9 分钟前
redis如何实现发布/订阅功能?
java·后端·面试
雷渊9 分钟前
redis中的zset怎么实现的?
java·后端·面试
Anarkh_Lee11 分钟前
图解JVM - 21.JVM运行时参数
java·jvm·后端
Anarkh_Lee13 分钟前
图解JVM - 22.分析GC日志
java·jvm·后端
kong790692820 分钟前
SpringBoot整合SSM
java·spring boot·ssm
骑牛小道士21 分钟前
java基础使用- 泛型
java·开发语言
LeonNo1123 分钟前
Spring常见问题复习
java·spring·rpc
KNeeg_35 分钟前
SpringSecurity框架入门
java·spring·spring cloud·springsecurity