spring - 缺少工件 oracle:ojdbc6:jar:11.2.0.3
问题描述
我正面临“缺少工件 oracle:ojdbc6:jar:11.2.0.3”的问题。我浏览了很多博客,但都没有成功。
我也尝试过使用 ojdbc14、ojdbc7,但无法继续进行。
POM 文件依赖:
<!-- https://mvnrepository.com/artifact/oracle/ojdbc6 -->
<dependency>
<groupId>oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>
MAVEN 错误: Maven 错误
我尝试将 oracle jar 文件安装到本地存储库,但收到以下错误。
mvn install:install-file -Dfile={C:\Users\Riya.m2\repository\com\oracle\ojdbc6\11.2.0.3} -DgroupId=oracle -DartifactId=ojdbc6 -Dversion=11.2.0.3 -Dpackaging=jar - DlocalRepositoryPath=C:\Users\Riya.m2\repository
C:\Preeti_WORK\WorkSpace\SPRING-BATCH\SpringWriteToDB>mvn install:install-file -Dfile={C:\Users\Riya\.m2\repository\com\oracle\ojdbc6\11.2.0.3} -DgroupId=oracle -DartifactId=ojdbc6 -Dversion=11.2.0.3 -Dpackaging=jar -DloaclRepositoryPath=C:\Users\Riya\.m2\repository
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< com.spring:SpringWriteToDB >---------------------
[INFO] Building SpringBatchDemo 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ SpringWriteToDB ---
**[ERROR] The specified file 'C:\Preeti_WORK\WorkSpace\SPRING-BATCH\SpringWriteToDB\{C:\Users\Riya\.m2\repository\com\oracle\ojdbc6\11.2.0.3}' not exists
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default-cli) on project SpringWriteToDB: The specified file 'C:\Preeti_WORK\WorkSpace\SPRING-BATCH\SpringWriteToDB\{C:\Users\Riya\.m2\repository\com\oracle\ojdbc6\11.2.0.3}' not exists -> [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/MojoFailureException
我按照以下链接中的步骤操作,但无法继续。 缺少工件 com.oracle:ojdbc6:jar:11.2.0.3,
我在我的个人笔记本电脑上使用,与setting.xml
文件有关吗?我面临公司笔记本电脑的问题,因为它具有本地存储库设置。
解决方案
输出很清楚:
指定的文件“C:\Preeti_WORK\WorkSpace\SPRING-BATCH\SpringWriteToDB{C:\Users\Riya.m2\repository\com\oracle\ojdbc6\11.2.0.3}”不存在
我假设你从这个目录运行命令
'C:\Preeti_WORK\WorkSpace\SPRING-BATCH\SpringWriteToDB\'.
只需将您的 jar 放入该目录并运行:
mvn install:install-file -Dfile=myfile.jar -DgroupId=oracle -DartifactId=ojdbc6 -Dversion=11.2.0.3 -Dpackaging=jar -DlocalRepositoryPath=C:\Users\Riya.m2\repository
Maven 将在此处期望 jar 文件 'C:\Preeti_WORK\WorkSpace\SPRING-BATCH\SpringWriteToDB\myfile.jar' 它将安装您的工件。
重要提示: 使用文件的完整路径更安全。上一个命令将使用文件的相对路径。
mvn install:install-file -Dfile=C:\Preeti_WORK\WorkSpace\SPRING-BATCH\SpringWriteToDB\ojdbc6.jar -DgroupId=oracle -DartifactId=ojdbc6 -Dversion=11.2.0.3 -Dpackaging=jar -DlocalRepositoryPath=C:\Users\Riya.m2\repository
推荐阅读
- javascript - 两个 Sum 令人困惑的错误
- r - RMarkdown:无法编织到 pdf
- python - 缩放和移动热图python
- python - 如何在整个脚本中发生 *any* 错误时捕获?
- java - 从 JPanel 调用函数
- azure-active-directory - Office.js:OfficeRuntime.auth.getAccessToken 成功获取令牌,但验证失败(“无法匹配密钥”)
- php - 如何为每个用户分配子域 - laravel
- wordpress - 如何在 2 台服务器上安装相同的 SSL 证书?
- twitter - 如何获取多个帐户的实时 Twitter 关注者数量(免费)?
- c++ - Stroustrup PPP2 图形问题