Problem with Maven (dependencies)

I'm pretty sure this is fully my fault and not IDEA's but in case someone happens to know the workaround...

I just switched to a new laptop and re-installed IDEA (upgraded to 14.1.2) and Maven (upgraded to 3.3.3). Now my Oracle Driver is giving me trouble:

1) Installed driver into local repository:

mvn install:install-file -Dfile=D:\Data\Downloads\ojdbc6.jar -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.4 -Dpackaging=jar

2) pom.xml has:

<dependency>
     <groupId>com.oracle</groupId>
      <artifactId>ojdbc6</artifactId>
      <version>11.2.0.4</version>
</dependency>

No highlighted errors in pom.xml.

IDEA is set to use the external Maven (3.3.3). Or so I think...

3) Compile goal from IDEA GUI is giving me:

D:\Programs\Java\x64\jdk\1.7\bin\java "-Dmaven.multiModuleProjectDirectory=D:\Data\Version Control\CustomerX\Subversion\my-project\main" -Dmaven.home=D:\Programs\Apache\Maven -Dclassworlds.conf=D:\Programs\Apache\Maven\bin\m2.conf -Didea.launcher.port=7536 "-Didea.launcher.bin.path=D:\Programs\JetBrains\IntelliJ IDEA 14.1\bin" -Dfile.encoding=UTF-8 -classpath "D:\Programs\Apache\Maven\boot\plexus-classworlds-2.5.2.jar;D:\Programs\JetBrains\IntelliJ IDEA 14.1\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=14.1.2 compile
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building my-project 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.oracle:ojdbc6:jar:11.2.0.4 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.197 s
[INFO] Finished at: 2015-05-08T20:19:04+03:00
[INFO] Final Memory: 7M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project my-project: Could not resolve dependencies for project com.my.project:my-project:jar:1.0-SNAPSHOT: Failure to find com.oracle:ojdbc6:jar:11.2.0.4 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]
[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/DependencyResolutionException


Process finished with exit code 1

If I run "mvn compile" on external command prompt instead of IDEA then build works. So something is not correctly configured, right?

Thanks in advance...

6 comments
Comment actions Permalink

Hi Jan,

What happens when you run 'mvn compile' from the command line?

Denis

0
Comment actions Permalink

"If I run "mvn compile" on external command prompt instead of IDEA then build works." ^

mvn compile works outside IDEA GUI.

0
Comment actions Permalink

Please ensure that the ide is configured to use the same local maven repo (Preferences | Build, Execution, Deployment | Build Tools | Maven | Local repository)

Denis

0
Comment actions Permalink

Looks like it is:

C:\Users\jsandhol\.m2\repository

Contains:

C:\Users\jsandhol\.m2\repository\com\oracle\ojdbc6\11.2.0.4

With:

_remote.repositories
ojdbc6-11.2.0.4.jar
ojdbc6-11.2.0.4.pom

0
Comment actions Permalink

I think I have found the reason for the problem. I have relocated Documents folder to a separate data disk. This should not have any effect on Maven since .m2 folder is above the Documents folder in the hierarchy (the default location). And indeed mvn on command line works as it should (maven is only in path, no maven_home, m2_home etc.).

IDEA settings also point to the correct original repository: C:\Users\jsandhol\.m2\repository. However, IDEA is not using that repository even when it should (according to it's own settings). I just noticed it's always creating new repository under my relocated Documents folder. Maybe a bug in IDEA after all?

Anyway it looks to be fixable now that I know what the problem is. Thanks for the help anyways.

0
Comment actions Permalink

File | Settings | BED | Build Tools | Maven | Repositories and then Update each repository don't work?

0

Please sign in to leave a comment.