2

I have executed:

mvn install:install-file -DgroupId=com.oracle 
-DartifactId=ojdbc7 -Dfile=ojdbc7.jar -Dpackaging=jar -Dversion=12.1.0.2

The installation succeeds...

[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------------< XXXX:XXXX >----------------------------
[INFO] Building XXXX 18.2.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ XXXX ---
[INFO] Installing C:\Projects\XXXX-svn\trunk\XXXX\ojdbc7.jar to C:\Users\QXV0615\.m2\repository\com\oracle\ojdbc7\12.1.0.2\ojdbc7-12.1.0.2.jar
[INFO] Installing C:\Users\QXV0615\AppData\Local\Temp\mvninstall491035374333687338.pom to C:\Users\QXV0615\.m2\repository\com\oracle\ojdbc7\12.1.0.2\ojdbc7-12.1.0.2.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.096 s
[INFO] Finished at: 2018-07-06T07:30:13+02:00
[INFO] ------------------------------------------------------------------------

But then

mvn install

[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------------< XXXX:XXXX >----------------------------
[INFO] Building XXXX 18.2.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
[WARNING] The POM for com.oracle.jdbc:ojdbc7:jar:12.1.0.2 is missing, no dependency information available
[WARNING] The POM for com.ibm.mq:jms:jar:7.0.1.9 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.993 s
[INFO] Finished at: 2018-07-06T07:30:26+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project XXXX: Could not resolve dependencies for project XXXX:XXXX:war:18.2.0-SNAPSHOT: The following artifacts could not be resolved: com.oracle.jdbc:ojdbc7:jar:12.1.0.2, com.ibm.mq:jms:jar:7.0.1.9: Failure to find com.oracle.jdbc:ojdbc7:jar:12.1.0.2 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

The dependency is specified as follows:

    <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc7</artifactId>
        <version>12.1.0.2</version>
    </dependency>

EDIT

I have also tried

mvn install:install-file -DgroupId=com.oracle 
-DartifactId=ojdbc7 -Dfile=ojdbc7.jar -Dpackaging=jar -Dversion=12.1.0.2 -DgeneratePom=true

-DgeneratePom=true

And it still doesn't find the file!

Mureinik
  • 297,002
  • 52
  • 306
  • 350
Jim
  • 14,952
  • 15
  • 80
  • 167
  • How is this a duplicate of the question at the given link..? This specifically asks about the artifact being present in the local repo... Neither the question nor the answers on that post address this... – ernest_k Jul 06 '18 at 05:44
  • @ernest, thanks - perhaps you can actually help, instead of pointing me to an answer that doesn't help one bit. – Jim Jul 06 '18 at 05:57
  • @ErnestKiwele I reopened this so now you can provide the correct answer. I expect you to do that, since you've been so involved in this question without actually doing anything really. Now's your chance to shine. – Kayaman Jul 06 '18 at 06:04
  • 1
    @Kayaman No, that's wrong. It was closed incorrectly and that's why it was reopened. Thanks. I also want to see the answer, so my responsibility was to challenge the incorrect "duplicate" decision. – ernest_k Jul 06 '18 at 06:09

2 Answers2

1

According to the error message:

The POM for com.oracle.jdbc:ojdbc7:jar:12.1.0.2 is missing, no dependency information available

Your groupId is wrong - it should be com.oracle.jdbc, and not just com.oracle as your snippet (\s added to make the example easier to read, they aren't a necessary part of the solution):

mvn install:install-file \
    -DgroupId=com.oracle.jdbc \
    -DartifactId=ojdbc7 \
    -Dfile=ojdbc7.jar \
    -Dpackaging=jar \
    -Dversion=12.1.0.2 \
    -DgeneratePom=true

Note that you'll still have to do something similar for the jms jar you're missing in the second error method.

Mureinik
  • 297,002
  • 52
  • 306
  • 350
  • There seems to be both `groupId`s in use. It looks like `com.oracle` is for a jar that's downloaded from Oracle's website and `com.oracle.jdbc` is for one from Oracle's Maven repo. Based on https://stackoverflow.com/questions/37783669/how-to-add-ojdbc7-to-java-web-app-by-gradle – Kayaman Jul 06 '18 at 06:45
0

Place the jar in your lib directory and You can use like this .

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>ojdbc7</artifactId>
    <version>12.1.0.2</version>

<systemPath>
${basedir}/src/main/webapp/WEB-INF/lib/ojdbc7.jar
</systemPath>
</dependency>
ap.singh
  • 1,150
  • 4
  • 15
  • 35