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

相关推荐
小莫分享42 分钟前
github 镜像节点
java
链上Sniper1 小时前
智能合约状态快照技术:实现 EVM 状态的快速同步与回滚
java·大数据·linux·运维·web3·区块链·智能合约
缘来是庄1 小时前
设计模式之建造者模式
java·设计模式·建造者模式
小湘西2 小时前
Apache HttpClient 的请求模型和 I/O 类型
java·http·apache
沃夫上校2 小时前
Feign调Post接口异常:Incomplete output stream
java·后端·微服务
q567315232 小时前
Java Selenium反爬虫技术方案
java·爬虫·selenium
张小洛2 小时前
Spring IOC容器核心阶段解密:★Bean实例化全流程深度剖析★
java·后端·spring·ioc容器·bean实例化
不良手残2 小时前
IDEA类和方法注释模板设置-保姆教程
java·开发语言
GoodStudyAndDayDayUp2 小时前
调用海康API预览视频
java·海康
李迟2 小时前
在Linux服务器上使用kvm创建虚拟机
java·linux·服务器