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

相关推荐
d_dreamer20 小时前
SeaTunnel推荐Maven版本
java·maven
清心歌20 小时前
记一次系统环境变量更改后在IDEA中无法读取新值的排查过程
java·后端·intellij-idea·idea
大尚来也20 小时前
驾驭并发:.NET多线程编程的挑战与破局之道
java·前端·算法
dong__csdn20 小时前
jdk添加信任证书
java·开发语言
hhcccchh21 小时前
1.1 HTML 语义化标签(header、nav、main、section、footer 等)
java·前端·html
随风,奔跑21 小时前
Spring Security
java·后端·spring
yaaakaaang21 小时前
十二、代理模式
java·代理模式
花千树-01021 小时前
Java 接入多家大模型 API 实战对比
java·开发语言·人工智能·ai·langchain·ai编程
卓怡学长21 小时前
m326数据结构课程网络学习平台的设计与实现+vue
java·spring·tomcat·maven·intellij-idea·mybatis
han_hanker1 天前
@Validated @Valid 用法
java·spring boot