Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is in the packed Maven index (nexus-maven-repository-index.gz)?

Where can I find some more details on what is contained in a Maven repository's Maven Index? Where can one find more details on how this all works? I am somewhat familiar with the maven-indexer, but I still have some grey spots...

What is the difference between the unpacked and packed indexes?

Does a Maven proxy repository have just the remote's index, or does it also keep an index of what artifacts it currently has cached locally?

A thorough and sufficiently lengthy reply would be highly appreciated, as I'm researching the topic and there's, unfortunately, little documentation about it.

like image 783
carlspring Avatar asked Jan 03 '17 14:01

carlspring


People also ask

What is Maven repository index?

About Maven-Indexer Apache Maven Indexer (former Sonatype Nexus Indexer) is the defacto standard for producing indexes of Maven repositories. The Indexes are produced and consumed by all major tools in the ecosystem.

What is Nexus repository in Maven?

In Configuring Maven to Use a Single Repository Group a single profile called nexus is defined. It configures a repository and a pluginRepository with the id central that overrides the same repositories in the Super POM. The Super POM is internal to every Apache Maven install and establishes default values.

Does Nexus support Maven?

Nexus Repository 3 does in fact support Maven (2) as a format.


1 Answers

There's a good amount of info on it here, with some more nerdier details: Nexus Indexer 2.0: incremental downloading

To get started with your questions, the nexus-maven-repository-index.gz contains all of the content for the repository. Using Central as an example, this would be EVERYTHING in central. Alongside this index, an incremental index is also generated that has all the changes since the last time the index was run. A list of these is stored in nexus-maven-repository-index.properties. These incremental indexes are there so that the full index does not need to be downloaded all the time.

Unpacked indexes are used for searching/browse remote functionality, packed indexes are used for transfer from the remote to the proxy/tool.

A Maven proxy repository can download the remote index if available mainly for browsing the remote's assets. This occurs in Nexus Repository 2, but not in 3. In 3, the index is downloaded and can be used by Dev tools to explore the remotes contents, the biggest difference being we don't use it to populate anything inside of Nexus Repository itself. Searches by Maven will be run against the remote index if available, and then the local index.

Proxies in Nexus Repository Manager keep an index of their own, and will download the remote index if it exists. The local will contain the contents locally, the remote will contain the content of the remote.

The gz file is simply a means of storing the lucene index contents for transfer, which is unpacked upon retrieval and put into the local lucene index. The contents are not actual lucene indexes, just the contents, to protect against future lucene version updates.

A packed index is generated with you run certain tasks in Nexus Repository Manager, such a Publish Index. This runs based on whatever schedule you determine.

For group repositories an index would be created from all the member indexes, which would include remote indexes if available, otherwise all local indexes that we know about.

Regardless of repository type, the lucene index is what is checked when doing a search.

Some extra blog posts about the Indexer:

  • Nexus Indexer API: Part 1
  • Nexus Indexer API: Part 2
  • Nexus Indexer API: Part 3
like image 198
DarthHater Avatar answered Sep 28 '22 06:09

DarthHater