报错:Cannot resolve com.microsoft.sqlserver:sqljdbc4:4.0  和  Missing artifact com.microsoft.sqlserver:sqljdbc4:jar:4.0

原因:当我们项目中用到的数据库为sql server时  我们一般在maven项目的pom.xml只添加依赖:

<dependency>
    <groupId>com.microsoft.sqlserver</groupId>
    <artifactId>sqljdbc4</artifactId>
    <version>4.0</version>
</dependency>

但是添加完之后  pom.xml会提示:Missing artifact com.microsoft.sqlserver:sqljdbc4:jar:4.0

制定路径下确实没有sqljdbc4.jar文件。

微软不允许以maven的方式直接下载该文件

解决方法:

下载 sqljdbc4.jar

官网下载

windows版本http://go.microsoft.com/fwlink/?LinkId=144633&clcid=0x804

UNIX版本http://go.microsoft.com/fwlink/?LinkId=144635&clcid=0x804

官网地址:https://www.microsoft.com/en-us/download/details.aspx?id=11774

推荐几个网站:

http://maven.ibiblio.org/maven/

https://www.kumapai.com/open

http://www.java2s.com/Code/Jar/CatalogJar.htm

几乎什么都能下载了吧,何必花积分在下载区下载呢

(jar包查找网站https://www.findjar.com/网站简介:findJAR.com is a JAR search engine that helps Java developers to find JAR libraries containing required Java classes.)

添加新文件夹 C:\Users\Administrator\.m2\repository\sqlserver\sqljdbc4\4.0

将sqljdbc4-4.0.jar文件放进去

运行命令

mvn install:install-file -Dfile=sqljdbc4-4.0.jar -DgroupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0 -Dpackaging=jar

解释:mvn install:install-file -Dfile=“jar包的绝对路径” -Dpackaging=“文件打包方式” -DgroupId=groupid名 -DartifactId=artifactId名 -Dversion=jar版本

测试

进入maven仓库,发现sqljdbc4.jar已经安装。

执行相关项目的maven,编译通过。idea 标红消失

报错:Failure to find com.oracle:ojdbc6:pom:11.2.0.3

原因:Oracle的ojdbc.jar是收费的,所以maven的中央仓库中没有这个资源,只能通过配置本地库才能加载到项目中去。

下载ojdbc6-11.2.0.3.jar

下载ojdbc6地址:https://mvnrepository.com/artifact/oracle/ojdbc6/11.2.0.3

新建C:\Users\Administrator\.m2\repository\ojdbc6\11.2.0.3,将ojdbc6-11.2.0.3.jar放进去,在该目录运行

mvn install:install-file -Dfile=jdbc6-11.2.0.3.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar

注意:不能把jar包放在本地仓库目录里,会报错的

下载ojdbc6-11.2.0.1.0.jar

http://central.maven.org/maven2/com/jslsolucoes/ojdbc6/11.2.0.1.0/ojdbc6-11.2.0.1.0.jar

新建C:\Users\Administrator\.m2\repository\ojdbc6\11.2.0.1.0,将ojdbc6-11.2.0.1.0.jar放进去,在该目录运行

mvn install:install-file -Dfile=ojdbc6-11.2.0.1.0.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0 -Dpackaging=jar

安装成功

tomcat-jdbc-8.5.14

https://www.mvnjar.com/org.apache.tomcat/tomcat-jdbc/8.5.14/detail.html

其他操作同上

maven仓库报错 sqljdbc4、ojdbc6、tomcat-jdbc-8.5.14的更多相关文章

  1. K.O. -------- Eclipse中Maven的报错处理

    ----------------------siwuxie095                                 K.O. -------- Eclipse 中 Maven 的报错处理 ...

  2. ojdbc15-10.2.0.4.0.jar maven 引用报错 Dependency 'com.oracle:ojdbc15:10.2.0.4.0' not found

    ojdbc15-10.2.0.4.0.jar maven 引用报错 问题现象 在 Maven 工程中引用 ojdbc15-10.2.0.4.0.jar 报错,报错信息:Dependency 'com. ...

  3. STS新建的maven项目报错问题

    STS新建的maven项目报错问题 解决方法:打开pom.xml文件添加 <dependency> <groupId>javax.servlet</groupId> ...

  4. maven插件报错之解决

    maven插件报错之解决 用m2eclipse创建Maven项目时报错 maveneclipsebuilddependenciesauthorizationplugins 用m2eclipse创建 ...

  5. Maven的安装、配置及使用入门+maven安装报错:JAVA_HOME【申明:来源于网络】

    Maven的安装.配置及使用入门+maven安装报错:JAVA_HOME[申明:来源于网络] Maven的安装.配置及使用入门:http://www.cnblogs.com/dcba1112/arch ...

  6. java项目连接jdbc报错:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server

    java项目连接jdbc报错:com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not creat ...

  7. maven构建报错org.apache.maven.lifecycle.LifecycleExecutionException

    2017年06月04日 15:03:10 阅读数:7991 maven构建报错 org.apache.maven.lifecycle.LifecycleExecutionException: Fail ...

  8. 【maven】ecplise新建maven项目 报错Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin

    在ecplise上新建maven项目 报错: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resourc ...

  9. gitlab使用URL导入远程仓库报错

    gitlab使用URL导入远程仓库报错Import url is blocked: Only allowed ports are 80,443, and any over 1024 报错内容为Impo ...

随机推荐

  1. iptables学习2

    Firewall:工作在主机或网络边缘,对进出的报文按事先定义的规则进行检查, 并且由匹配到的规则进行处理的一组硬件或软件,甚至可能是两者的组合 隔离用户访问,只允许访问指定的服务    通过ADSL ...

  2. Spring Cloud微服务安全实战_3-5_API安全之常见问题

    1,数据校验,解决接口层的参数校验,是api安全的前线.可以用JSR303注解进行接口层面的校验 ,参考文章:https://www.ibm.com/developerworks/cn/java/j- ...

  3. Codeforces Round #605 (Div. 3) 题解

    Three Friends Snow Walking Robot Yet Another Broken Keyboard Remove One Element Nearest Opposite Par ...

  4. <matrix> 73 329

    73. Set Matrix Zeroes - 先扫描第一行第一列,如果有0,则将各自的flag设置为true- 然后扫描除去第一行第一列的整个数组,如果有0,则将对应的第一行和第一列的数字赋0- 再 ...

  5. 【转】jsp 页面 按回车键 触发事件

    转载: https://blog.csdn.net/ludongshun2016/article/details/59536779. 第一种: <script type="text/J ...

  6. [LeetCode] 727. Minimum Window Subsequence 最小窗口序列

    Given strings S and T, find the minimum (contiguous) substring W of S, so that T is a subsequence of ...

  7. [LeetCode] 370. Range Addition 范围相加

    Assume you have an array of length n initialized with all 0's and are given k update operations. Eac ...

  8. CF 715 E. Complete the Permutations

    CF 715 E. Complete the Permutations 题目大意:给定两个排列\(p,q\)的一部分.定义两个排列\(p,q\)的距离为使用最少的交换次数使得\(p_i=q_i\).对 ...

  9. Linux内核同步机制之原子操作

    1.前言 原子操作指的是该操作不会在执行完毕之前被任何其它任务或事件打断,它是最小的执行单位,不会有比它更小的执行单位,原子实际上使用了物理学中物质微粒的概念,在Linux内核中,原子操作需要硬件的支 ...

  10. Reflector调试dll功能

    Reflector不仅仅是一个反编译工具,之前用Resharper,把这个给忽略了,这个Reflector还有一个调试dll功能, 在调试时反编译代码,会生成对应的pdb文件,就可以进行dll源码调试 ...