0
votes

Issue is manually uploaded artifact to release repository not resolving from Nexus group repository defined in the settings.xml.

I've tried including http://localhost:8081/nexus/content/repositories/releases repository into the /nexus/content/groups/public repository and define group repo path as mirror in the settings.xml.

<settings>
  .......
  <mirrors>
    <mirror>
      <id>myteam-nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://localhost:8081/nexus/content/groups/public </url>
    </mirror>
  </mirrors>
  .....
</settings>

In the Nexus I've below custom JAR as follows:

<dependency>
  <groupId>com.xxxx.bank</groupId>
  <artifactId>xxxxxcallws</artifactId>
  <version>1.0</version>
</dependency>

pom.xml

<project>
  <dependencies>
    <dependency>
      <groupId>com.xxxx.bank</groupId>
      <artifactId>xxxxxcallws</artifactId>
      <version>1.0</version>
    </dependency>

    <dependency>
      <groupId>org.json</groupId>
      <artifactId>json</artifactId>
      <version>20160212</version>
    </dependency>
  </dependencies>


  <distributionManagement>
    <repository>
      <id>releases</id>
      <!-- CHANGE HERE by your team nexus server -->
      <url>http://localhost:8081/nexus/content/repositories/releases/</url>
    </repository>
    <snapshotRepository>
      <id>snapshots</id>
      <!-- CHANGE HERE by your team nexus server -->
      <url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
    </snapshotRepository>
  </distributionManagement>
</project>

When I run the mvn clean install -U giving me error saying:

Could not find artifact com.xxxx.bank:xxxxxcallws:jar:1.0 in myteam-nexus (http://localhost:8081/nexus/content/groups/public)

NOTE: This JAR uploaded into release repository (http://localhost:8081/nexus/content/repositories/releases) and I've added same repo into public group repo from Nexus admin UI.

But same way I've added Maven Central proxy in to public group and dependencies from Central is pulling, but the JAR I've uploaded can't find the location via public repository.

1
Did you try invalidating cache on the NXRM side in case it (rather than maven) cached a not found? Do you see the jar in your UI?joedragons
yes jar i can see there in the nexus, since it was uploaded manuallyCharaka Wijesinghe
Did you check the path in NXRM vs what maven is saying? e.g. can you download localhost:8081/nexus/content/groups/public/com.xxxx.bank/… via your webbrowser or curl (with proper permissions)? You'll have to fill in the xxxxx blanks, but hopefully you get my idea=)joedragons

1 Answers

0
votes

When you are uploading the jar manually Nexus add classifier automatically. Remove the existing jar from nexus and upload it again without classifier.

enter image description here