Nexus Repository Management

2012 Oct 21

  • Installed Nexus OSS War file on phoenix tomcat.
    • Plopped it down in the webapps directory (cd2tomcat)
    • Used the sonatype-work directory created under /usr/local
    • Gave 'tomcat' user ownership of this directory
  • Admin Setup as suggested by Sonatype documentation (Post-Install)
    • Changed password on the admin account
    • Tested out the SMTP settings
    • Allowed indexes to be downloaded for recommended repositories.

Site is accessed here: http://phoenix:8080/nexus. It would be interesting to make this available over the internet.

2012 Oct 28

  • I was able to successfully add and resolve the smart-gwt artifacts that I needed to make available.
  • On Saturday however, I seem to have lost the ability to pickup certain .jar files. Each of these files resulted in this exception: org.sonatype.aether.connector.async.ResourceDoesNotExistException:
http://phoenix:8080/nexus/content/groups/public/org/apache/maven/surefire/surefire-api/2.10/surefire-api-2.10.jar. Error code 404
http://phoenix:8080/nexus/content/groups/public/org/apache/maven/surefire/surefire-booter/2.10/surefire-booter-2.10.jar. Error code 404
http://phoenix:8080/nexus/content/groups/public/org/apache/maven/surefire/maven-surefire-common/2.10/maven-surefire-common-2.10.jar. Error code 404
http://phoenix:8080/nexus/content/groups/public/org/codehaus/plexus/plexus-utils/2.1/plexus-utils-2.1.jar. Error code 404
  • It was clear the .jar file was not downloaded as I expected it to be. It did not show in the index for either the public group, or even the Central repository although the .pom and other files were available.
  • I forced the download of the Central repository by turning off the option to download the index and then turning it back on again. This did make the expected .jar files show up in the Central repository's index, and the public group's index, but the file was still not being downloaded. It was not in the "browse storage" tab of the public group repository.
  • The next thing — which is probably just a distraction — is the following message in the Nexus logs:
2012-10-29 18:37:53 ERROR [http-8080-23   ] - org.sonatype.nexus.proxy.maven.maven2.M2Repository - Got RemoteStorageException in proxy repository "Central" [id=central] while retrieving remote artifact "ResourceStoreRequest(requestPath="/org/apache/maven/shared/maven-common-artifact-filters/1.3/maven-common-artifact-filters-1.3.pom")" from URL http://repo1.maven.org/maven2/, this is 1 (re)try, cause: java.net.SocketException: Connection reset
  • This message is also found in the Tomcat server's catalina.out.
  • When try using Chrome to bring up the same URL, I also get a "Connection reset" message.
  • I didn't think about this at first — because there were no exceptions for the file — but the maven-common-artifact-filters-1.3.pom may have been the real problem file. Once I uploaded this file to the repository, several of the subsequent files — including the four listed above — were all able to be loaded.
  • Then I got a problem downloading this file:
/org/apache/maven/doxia/doxia-logging-api/1.1.2/doxia-logging-api-1.1.2.jar

SO, I downloaded it and installed it too.
  • It took me a long time to find the way to "expire cache". It looks like once Nexus decided it wasn't going to be able to find a particular artifact, it wasn't going to try that file anymore until the cache had been expired.

Expire Cache

  1. In the Nexus Admin: (http://phoenix:8080/nexus/index.html#view-repositories;public~browsestorage), choose the Public Storage
  2. In a branch above the problem spot, right-click and choose "Expire Cache".
  3. You should see the log file for nexus indicate it is kicking off a scheduled task to re-index a portion of the file system as indicated in the message.

Update from July 2014

A similar issue can occur when the local repository has recorded a "lastUpdated" file which means it won't retry the file for some period of time. If this happens at a high enough level (for example, if the remote connection was broken when an attempt was made), then the entire site will not be refreshed nor indices rebuilt. In this case, you'll want to pass the '-U' parameter to the mvn command line.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License