The Maven index
Artifex publishes an Apache Maven Indexer index for each repository. IDEs such as IntelliJ IDEA, Eclipse, and NetBeans use the index for dependency completion and artifact search.
Use the index in an IDE
Add the repository to your build as described in Resolve dependencies, and let your IDE download its index. IntelliJ IDEA, for example, downloads the index for each configured repository and refreshes it in the background.
Reading the index follows the same access rules as reading any other file in the repository.
When the index is published
A repository change is published to the index about an hour later. Changes that arrive during that hour are published together.
After your first deployment, publish the index if you don't want to wait.
Publish now or rebuild
You need the Write or Admin repository role.
To publish pending changes, follow these steps:
- Open the repository and go to Settings.
- In the Search index section, click Publish now.
If nothing changed since the last publication, Artifex doesn't publish an update.
To rebuild the index, follow these steps:
- Open the repository and go to Settings.
- In the Search index section, click Rebuild.
A rebuild writes the complete index, and IDEs download it in full. Rebuild when the index and repository contents 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 publication.
What the index covers
The What the search index covers setting controls which files the index describes.
| Setting | What the index covers |
|---|---|
| Only what you publish here | Only files deployed directly to this repository |
| Everything, including files fetched from upstreams | Directly deployed files and files fetched from upstreams |
Only what you publish here is the default. Use it when the repository has upstreams and the IDE already has indexes for those upstream repositories. Indexing a large public upstream repository can duplicate most of its index in Artifex.
Choose Everything, including files fetched from upstreams when Artifex is the only repository that the IDE knows about and fetched files must appear in dependency completion. The setting affects the next publication. Rebuild the index to apply the setting to all existing entries.
Advanced
The index uses the Apache Maven Indexer format, formerly called the Sonatype Nexus Indexer format. The index files are under .index/ in the repository, at https://artifex.soh.gg/maven/OWNER/REPOSITORY_NAME/.index/:
| File | Description |
|---|---|
nexus-maven-repository-index.properties | The index identity, timestamp, and available incremental parts |
nexus-maven-repository-index.gz | The complete index |
nexus-maven-repository-index.N.gz | Incremental part N, containing changes after the preceding part |
Each .gz file also has adjacent .sha1 and .md5 files. Artifex generates the index, so it refuses uploads under .index/ with 403 Forbidden.
The first publication writes the complete index and starts an incremental chain. Each later publication adds one incremental part and rewrites the complete index. A client without an index downloads the complete file. A client that has an earlier index downloads only the missing incremental parts. Artifex retains up to 30 incremental parts and deletes older ones. Artifex rebuilds the chain each week. Clicking Rebuild on the Settings page does the same immediately.