Skip to content

The Maven index

Artifex publishes a Maven index for each repository. IDEs such as IntelliJ IDEA, Eclipse, and NetBeans read the index to offer dependency completion and to search for artifacts.

Use the index in an IDE

Add the repository to your build as described in Resolve dependencies, and let your IDE index it. IntelliJ IDEA, for example, downloads the index for each repository it knows about and refreshes it in the background.

Reading the index needs read permission, like any other file in the repository.

When the index is published

A change to the repository is published to the index about an hour later. Changes that arrive in that hour are published together, so a busy repository publishes about once an hour rather than once per file.

The index has to exist before an IDE can read it, so publish it once after your first deploy if you don't want to wait.

Publish now, or rebuild

You need write permission.

To publish now, follow these steps:

  1. Open the repository and go to Settings.
  2. In the Search index section, click Publish now.

If nothing changed since the last publish, nothing is published.

To rebuild the index from the start, follow these steps:

  1. Open the repository and go to Settings.
  2. In the Search index section, click Rebuild.

A rebuild writes the whole index again, and IDEs download it in full. Rebuild when the index and the repository disagree.

The Search index section also shows when the index was last published, when it was last rebuilt, and how many changes are waiting for the next publish.

What the index covers

The What the search index covers setting decides which files the index describes.

SettingWhat the index covers
Only what you publish hereOnly the files deployed to this repository
Everything, including files fetched from upstreamsDeployed files and the files fetched from upstreams

Only what you publish here is the default, and it's what you want when the repository has upstreams: an index that covered a public mirror would describe most of the Maven world, and the IDE already has an index for that mirror.

Choose Everything, including files fetched from upstreams when the repository is the only one an IDE knows about and the fetched files should be offered for completion. Changing the setting affects the next publish; rebuild to apply it to the whole index at once.

Advanced

The format is the one that Nexus publishes. The index files are under .index/ in the repository, at https://artifex.soh.gg/maven/OWNER/SLUG/.index/:

FileWhat it is
nexus-maven-repository-index.propertiesThe index's identity, its timestamp, and which incremental parts exist
nexus-maven-repository-index.gzThe whole index
nexus-maven-repository-index.N.gzIncremental part N, which carries the changes since the part before it

Each .gz file also has .sha1 and .md5 next to it. The index is generated, so uploading anything under .index/ is refused with 403 Forbidden.

The first publish writes the whole index and starts a chain. Every publish after it adds one incremental part and rewrites the whole index, so a client starting fresh gets everything in one file and a client that already has the index downloads only the parts it's missing. Up to 30 incremental parts are kept; older parts fall out and their files are removed. Once a week, the chain is rebuilt from the start, and a rebuild from the Settings page does the same.