0

I am facing "Missing artifact oracle:ojdbc6:jar:11.2.0.3" issue. I went through a lot of blogs but was not successfull.

I tried with ojdbc14, ojdbc7 as well and I am not able to proceed further.

POM file dependency:

<!-- https://mvnrepository.com/artifact/oracle/ojdbc6 -->
        <dependency>
            <groupId>oracle</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>11.2.0.3</version>
        </dependency>

MAVEN error: Maven-error

I tried to install the oracle jar file onto local repository,but receiving the below error.

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

I followed the steps in the below link but couldn't progres. Missing artifact com.oracle:ojdbc6:jar:11.2.0.3,

I am using on my personal Laptop, is there something to do with the setting.xml file? I dint face issue with company laptop, as it has local repository settings.

PreetiG
  • 1
  • 1
  • 1

1 Answers1

0

The output is clear:

The specified file 'C:\Preeti_WORK\WorkSpace\SPRING-BATCH\SpringWriteToDB{C:\Users\Riya.m2\repository\com\oracle\ojdbc6\11.2.0.3}' not exists

I assume you ran the command from this directory

'C:\Preeti_WORK\WorkSpace\SPRING-BATCH\SpringWriteToDB\'. 

Just put your jar in that directory and run:

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 will expect jar file here 'C:\Preeti_WORK\WorkSpace\SPRING-BATCH\SpringWriteToDB\myfile.jar' and it will install you artifact.

Important Note: It's safer to use full path to the file. Previous command will use relative path to the file.

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
gmode
  • 3,601
  • 4
  • 31
  • 39
  • Thanks a lot for your suggestion. I tried to keep the jar in the same location as the maven project and ran the Install command.. Thought the jar is present in the correct location. It is still saying the same. "The specified file 'C:\Preeti_WORK\WorkSpace\SPRING-BATCH\SpringWriteToDB\ojdbc6.jar' not exists -> [Help 1]" – PreetiG Jul 21 '18 at 13:43
  • Can you pls suggest if there is some permission issue in reading the file . Where ever I place the file i receive the same error. `mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.x.x.x -Dpackaging=jar -Dfile=ojdbc14.jar -DgeneratePom=true` **The specified file 'D:\ojdbc14.jar' not exists -> [Help 1]** I tried with ojdbc14 jar as well. – PreetiG Jul 21 '18 at 13:58
  • the jar file should be placed in the directory where you are running the command. Just tried locally and command works fine. If you are running the command from D:\ directory, then 'D:\ojdbc14.jar will work. But to make sure, use the full path to the file. I'll edit the answer. – gmode Jul 22 '18 at 13:01