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

相关推荐
黄暄3 分钟前
Linux项目部署全攻略:从环境搭建到前后端部署实战
java·linux·运维·服务器·前端·后端·持续部署
艺杯羹9 分钟前
数据库连接池技术与 Druid 连接工具类实现
java·数据库·mysql·jdbc
我爱Jack12 分钟前
Mybatis操作数据库(2)
java·数据库·mybatis
island131428 分钟前
JAVA Web 期末速成
java·开发语言·前端
2401_895610821 小时前
Java 后端基础 Maven
java·开发语言·maven
努力学习的明1 小时前
Spring Bean 生命周期中设计模式的应用与解析
java·spring·设计模式·生命周期
薯条不要番茄酱1 小时前
【SpringBoot】从零开始全面解析SpringMVC (三)
java·spring boot·后端
IDRSolutions_CN2 小时前
PDF 合并测试:性能与内容完整性
java·经验分享·pdf·软件工程·团队开发
TDengine (老段)2 小时前
TDengine 在新能源领域的价值
java·大数据·数据库·人工智能·时序数据库·tdengine·涛思数据
helloworld工程师2 小时前
Java实现PDF加水印功能:技术解析与实践指南
java·开发语言·pdf