2

This is my pom.xml file:

<project ...>

    <repositories>
        <repository>
            <id>lib</id>
            <name>lib</name>
            <releases>
                <enabled>true</enabled>
                <checksumPolicy>ignore</checksumPolicy>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <url>file://${project.basedir}/src/lib</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>oracle.jdbc</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>11.2.0.4</version>
        </dependency>
        ...
    <dependencies>
    ...
</project>

But there is an error shown on the <dependency> tag: Missing artifact oracle.jdbc:ojdbc6:jar:11.2.0.4

The directory structure is this way:

test-project/
  src/
    lib/
      oracle/
        jdbc/
          ojdbc6/
            11.2.0.4/
              ojdbc6-11.2.0.4.jar

Anything missing in the pom.xml file or wrong directory structure?

jondinham
  • 8,271
  • 17
  • 80
  • 137

3 Answers3

1

After searching for hours, eventually found the answer works for me.

Your settings.xml file declares a catch-all mirror. This takes effect over the local repository declaration in your pom file. Either remove the catch-all mirror, or try excluding the repository ID of your project repository from the mirroring:

Replace <mirror>*</mirror> with <mirror>*,!lib</mirror> in your MAVEN/conf/settings.xml

0

This is the solution on Windows but it's quite funny:

Replace

file://${project.basedir}/src/lib

by

file://${project.basedir}\src\lib

Reference: See the comment in: http://blog.dub.podval.org/2010/01/maven-in-project-repository.html

jondinham
  • 8,271
  • 17
  • 80
  • 137
0

The best solution is start using a repository manager (Artifactory, Nexus, Archiva) and install the oracle jdbc driver there and than you can simply use it as a dependency.

If you really don't like to use a repository manager i can recommend the non-maven-jar-maven-plugin.

khmarbaise
  • 92,914
  • 28
  • 189
  • 235