报错: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. web框架--tornado框架之初识

    在python中常见的web框架构建模式有以下两种: *MVC框架: * 数据库相关操作的Models 视图文件的Views 业务逻辑的Controllers MTV框架: 数据库相关操作的Model ...

  2. [LeetCode] 1123. Lowest Common Ancestor of Deepest Leaves 最深叶结点的最小公共父节点

    Given a rooted binary tree, return the lowest common ancestor of its deepest leaves. Recall that: Th ...

  3. [LeetCode] 862. Shortest Subarray with Sum at Least K 和至少为K的最短子数组

    Return the length of the shortest, non-empty, contiguous subarray of A with sum at least K. If there ...

  4. 4.Python项目实战

    这里会每个周更新一个Python的大练习,作为 实战项目... elk

  5. .Net Core 基于CAP框架的事件总线

    .Net Core 基于CAP框架的事件总线 CAP 是一个在分布式系统中(SOA,MicroService)实现事件总线及最终一致性(分布式事务)的一个开源的 C# 库,她具有轻量级,高性能,易使用 ...

  6. python读写符号的含义

    r 打开只读文件,该文件必须存在. r+ 打开可读写的文件,该文件必须存在. w 打开只写文件,若文件存在则文件长度清为0,即该文件内容会消失.若文件不存在则建立该文件. w+ 打开可读写文件,若文件 ...

  7. Python 遍历目录下的子目录和文件

    import os A: 遍历目录下的子目录和文件 for root,dirs ,files in os.walk(path) root:要访问的路径名 dirs:遍历目录下的子目录 files:遍历 ...

  8. redis 清除minerd进程的方法

    redis 清除minerd进程的方法 1 修改redis配置文件 //禁止高危命令rename-command FLUSHALL ""rename-command CONFIG ...

  9. Extra:Variable Types

    文章著作权归作者所有.转载请联系作者,并在文中注明出处,给出原文链接. 本系列原更新于作者的github博客,这里给出链接. 在我们使用Cg或者HLSL进行shader编写的过程中,常常涉及到一些变量 ...

  10. history路由模式下的nginx配置

    路由模式 众所周知,浏览器下的单页面应用的路由模式有下面两种: hash 模式和 history 模式.hash 模式通用性好,而且不依赖服务器的配置,省心省力,但是缺点是不够优雅.相比于 hash ...