0
votes

I have access to a nexus repository and my settings.xml file gives me access to every jar file hosted in the maven central repository. My maven settings file is copied pretty much verbatim from the nexus documentation

<mirrors>
    <mirror>
      <!--This sends everything else to /public -->
      <id>public</id>
      <mirrorOf>*</mirrorOf>
      <url>http://nexus.company.domain/content/groups/public</url>
    </mirror>
 </mirrors>

Our integration team have a nexus repository configured to map to this:

http://nexus.company.domain/content/groups/public

And this works! However, obviously the oracle jar is not available in the mvn central repository. Our integration team have uploaded this jar into nexus, and this jar is available to download from there, but it is actually located in a different repository within nexus, namely:

http://nexus.company.domain/content/repositories/thirdparty

Including this dependency in my pom.xml file still doesn't find the artefact.

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

I have tried reading the (frankly poor IMO) documentation around configuring maven to point to two repositories and I am now stuck.

How do I configure my settings.xml to tell maven to look in 2 different nexus repositories?

1
You should configure your Nexus correctly and include the thirdparty into the public group. Does not make sense to configure that in Maven...khmarbaise
thanks, I suspected as much, unfortunately I have no control over the nexus configuration but I will accept thisDavid
also, if you want to add this as the answer I will accept itDavid

1 Answers

3
votes

The best solution is to configure Nexus to use the thirdParty repository as part of the public group in Nexus which is the default and best practice to have only one repository group which should be configured in Maven. So you can control the overall behaviour within Nexus and globally and not on a developer / computer base.