1
votes

I have setup a local Sonatype Nexus 3 repository with maven2 hosted mixed type repository as below:

enter image description here

and uploaded a jar into it.

Now when I try to hit the url http://localhost:8081/repository/myrepo/com/oracle/ojdbc8/1.0.0/ojdbc8-1.0.0.jar I am able to download the jar but when I try to build the project in Eclipse with following entry in pom.xml:

<dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc8</artifactId>
        <version>1.0.0</version>
</dependency>

I get the error in POM as:

enter image description here

In maven settings.xml, the configuration is as follows:

<server>
  <id>nexususer</id>
  <username>admin</username>
  <password>XXXXX</password>
</server>

And mirror as:

<mirror>
  <id>nexususer</id>
  <mirrorOf>*</mirrorOf>
  <name>myrepo</name>
  <url>http://localhost:8081/repository/myrepo</url>
</mirror>

Where am I making a mistake?

1

1 Answers

0
votes

In your pom.xml add these

<distributionManagement>
    <repository>
        <id>nexususer</id>
        <url>http://localhost:8081/repository/myrepo/</url>
    </repository>
</distributionManagement>

Right click your project -> maven -> update project