Question

I am trying to add dependency for ojdbc14 in pom.xml

OS: WindowsXP(sp3) IDE: ECLIPSE(Juno) DB: Oracle 10G

I am using m2e plugin in eclipse.

Steps I followed for adding ojdbc14.jar in local repository of maven

  1. create a new project > maven project > org.codehaus.mojo.archetypes webapp-j2ee1.4
  2. move to that particular folder where is pom.xml file was located in command prompt.
  3. execute the command mvn clean.

  4. execute the command ' mvn install:install-file -Dfile="D:\oracle10g\jdbc\lib\ojdbc14.jar" -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.1.0 -Dpackaging=jar '

after this I got a build success message

D:\Eclipse Workspace\BOOK_SHOP\BookShop>mvn install:install-file -Dfile="D:\oracle10g\jdbc\lib\ojdbc14.jar" -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.1.0 -Dpackaging=jar

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building BookShop 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) @ BookShop ---
[INFO] Installing D:\oracle10g\jdbc\lib\ojdbc14.jar to D:\Maven Repository\Local Repository\com\oracle\ojdbc14\10.2.0.1.0\ojdbc14-10.2.0.1.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.375s
[INFO] Finished at: Mon Oct 28 14:38:03 IST 2013
[INFO] Final Memory: 2M/15M
[INFO] ------------------------------------------------------------------------

I have updated the global and local repository in Eclipse > Maven Repositories

5 . I add dependency in pom.xml

enter image description here enter image description here

But I got error in my pom.xml file, and I am able to see the ojdbc14.jar file in my local repository. Is there any thing wrong in the steps I followed. Please help me out.

Thanks

Was it helpful?

Solution

Eclipse and your command line Maven use different repositories. The command line uses D:\Maven Repository\Local Repository\ while Eclipse uses %HOME%\.m2\repository

Find out why the two disagree (usually, the path in settings.xml is wrong or the two use different settings files).

OTHER TIPS

I found the answer, I just change the user settings, because it was pointed to the old repository, I changed it to point to the new repository.

Windows > preferences > maven > User Settings

Now its working fine.

Thanks for your help Aaron Digulla :)

Has the same problem , downloaded the jar from the oracle site . manually the jar in the maven local repo using below command

mvn install:install-file -Dfile=..\Downloads\ojdbc14.jar -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.4.0 -Dpackaging=jar

solved the problem for me

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top