Appearance
The Maven index
Artifex publishes a Maven index for each repository. IDEs read the index to offer dependency completion and to search for artifacts without asking the repository for every coordinate.
The format is the one that Nexus publishes and that IntelliJ IDEA, Eclipse, and NetBeans read.
Where the index is
The index files are under .index/ in the repository:
https://artifex.soh.gg/maven/OWNER/SLUG/.index/| File | What it is |
|---|---|
nexus-maven-repository-index.properties | The index's identity, its timestamp, and which incremental parts exist |
nexus-maven-repository-index.gz | The whole index |
nexus-maven-repository-index.N.gz | Incremental part N, which carries the changes since the part before it |
Each .gz file also has .sha1 and .md5 next to it.
Reading the index needs read permission, like any other file in the repository. The index is generated, so uploading anything under .index/ is refused with 403 Forbidden.
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.
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 for the scheduled publish.
When the index is published
A change to the repository schedules a publish one hour later. Changes that arrive in that hour join the same publish, so a busy repository publishes about once an hour rather than once per file.
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. A client that has been away longer than that downloads the whole index instead of a series of parts, which is what a rebuild makes it do.
Publish now, or rebuild
You need write permission.
To publish now, follow these steps:
- Open the repository and go to Settings.
- In the Maven 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:
- Open the repository and go to Settings.
- In the Maven index section, click Rebuild index.
A rebuild starts a new chain: the incremental parts are discarded, the whole index is written again, and clients download it in full. Rebuild when the index and the repository disagree.
The Maven 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.
Index scope
Index scope decides which files the index describes.
| Setting | What the index covers |
|---|---|
| Deployed files | Only the files deployed to this repository |
| Every file | Deployed files and the files cached from upstreams |
Deployed files 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 Every file when the repository is the only one an IDE knows about and the cached files should be offered for completion. Changing the setting affects the next publish; rebuild to apply it to the whole index at once.