You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/developer-guide/maven-indexer.md
+85-31Lines changed: 85 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,65 +43,114 @@ except a record for the POM.
43
43
Maven indexer also may or may not store a `.pom` file as an artifact. However, firstly it tries to find matching _real_
44
44
artifact file in the file system, switching over to indexing that, instead of the `.pom` file.
45
45
46
-
### What's not indexable
46
+
### What's not indexable ?
47
47
48
48
The following file types are not indexable:
49
49
50
50
*`maven-metadata.xml` files
51
51
*`.properties` files
52
52
* checksum and signature files `.asc`, `.md5`, `.sha1`
53
53
54
+
### What Are Packed Indexes?
55
+
56
+
Packed indexes are either a complete compressed index, or a compressed subset of data which can be applied to an
57
+
existing index incrementally.
58
+
59
+
## What's the goal of packed indexes ?
60
+
61
+
Packed indexes are used for transferring indexes from the remote to the proxy/tool.
62
+
54
63
## What Is The Maven Indexer Used For In The Strongbox Project?
55
64
56
65
The Maven Indexer is used for integration with IDE-s.
57
66
58
-
The Maven indexes produced by most public repository managers (such as Maven Central), are usually rebuilt once a week,
59
-
as it can take quite a while to scan large repositories with countless small artifacts. Hence, these indexes have proven
60
-
to not be quite as up-to-date, as the real server's contents. For this reason, we are using OrientDB to keep more
61
-
accurate information.
67
+
## How Does The Maven Indexer Work In Strongbox ?
68
+
69
+
Strongbox allows you to download packed repository Maven Index. Every maven repository with indexing enabled serves the packed Maven Index.
70
+
Based on the repository type, the index is prepared as follows:
71
+
72
+
*[Hosted][hosted-repositories-link] repositories:
73
+
74
+
Strongbox stores the information of uploaded artifacts (in hosted repositories) in the OrientDB database. This Information is used
75
+
to create the hosted repository Maven Index. Strongbox serves following [Maven Indexer Fields][maven-indexer-fields-link] in indexer:
76
+
77
+
* artifactId;
78
+
* version;
79
+
* classifier;
80
+
* packaging/extension
81
+
* classnames
82
+
* lastModified
83
+
* size
84
+
* signatureExists
85
+
* sha1
86
+
* sourcesExists
87
+
* javadocExists
88
+
89
+
For each hosted maven repository defined in strongbox there should be a scheduled task configured to rebuild the index (unless you don't
90
+
want to serve Maven Index for some repository). [Rebuild Maven Indexes Cron Job](https://github.com/strongbox/strongbox/blob/master/strongbox-storage/strongbox-storage-layout-providers/strongbox-storage-maven-layout/strongbox-storage-maven-layout-provider/src/main/java/org/carlspring/strongbox/cron/jobs/RebuildMavenIndexesCronJob.java)
91
+
is scheduled at strongbox startup on time specified by the `cronExpression` value within `repositoryConfiguration` in [strongbox.yaml][strongbox-yaml-link]
92
+
configuration file for `repository` with `type` equal to `hosted`.
93
+
94
+
The process of rebuilding the hosted repository Maven Index purges previous index and recreates it from scratch using OrientDB to keep
95
+
more accurate information. Thanks to this the index is up-to-date, as the real server's contents.
96
+
97
+
*[Proxy][proxy-repositories-link] repositories:
98
+
99
+
Strongbox fetches the proxy repository Maven Index from remote host, stores it locally and serves it. For each proxy maven repository
100
+
defined in strongbox there should be a scheduled task configured to re-fetch the index (unless you don't want to serve Maven Index
101
+
for some repository). [Download Remote Maven Index Cron Job](https://github.com/strongbox/strongbox/blob/master/strongbox-storage/strongbox-storage-layout-providers/strongbox-storage-maven-layout/strongbox-storage-maven-layout-provider/src/main/java/org/carlspring/strongbox/cron/jobs/DownloadRemoteMavenIndexCronJob.java)
102
+
is scheduled at strongbox startup on time specified by the `cronExpression` value within `repositoryConfiguration` in [strongbox.yaml][strongbox-yaml-link]
103
+
configuration file for `repository` with `type` equal to `proxy`.
104
+
105
+
Strongbox supports incremental proxy repository Maven Index. It means that it will update the index by downloading only the missing Maven
106
+
Index parts that were not downloaded before. Thanks to this feature, strongbox saves the bandwidth costs. Once the soft parts are downloaded,
107
+
they are merged with the locally existing part and finally packed.
108
+
109
+
The Maven indexes produced by most public repository managers (such as Maven Central), are usually rebuilt once a week.
110
+
111
+
*[Group][group-repositories-link] repositories:
112
+
113
+
Strongbox creates the group repository Maven Index by merging their underlying repositories Maven Indexes. This process is recursive meaning that
114
+
root group repository will contain in the Maven Index all the information stored in every inner and outer vertex repository Maven Index.
115
+
[Merge Maven Group Repository Index Cron Job](https://github.com/strongbox/strongbox/blob/master/strongbox-storage/strongbox-storage-layout-providers/strongbox-storage-maven-layout/strongbox-storage-maven-layout-provider/src/main/java/org/carlspring/strongbox/cron/jobs/MergeMavenGroupRepositoryIndexCronJob.java)
116
+
is scheduled at strongbox startup on time specified by the `cronExpression` value within `repositoryConfiguration` in [strongbox.yaml][strongbox-yaml-link]
117
+
configuration file for `repository` with `type` equal to `group`.
118
+
119
+
The process of rebuilding the group repository Maven Index purges previous index and recreates it from scratch to keep more accurate information.
120
+
121
+
## Where Are The Maven Indexes Located in Strongbox ?
62
122
63
123
There are two types of Maven Indexer indexes:
64
124
65
125
* Local
66
126
* For hosted repositories, this contains the artifacts that have been deployed to this repository.
67
-
* For proxy repositories, this contains the artifacts which have been requested and cached from the remote repository.
127
+
* For group repositories, this contains the merged index from the underlying repositories.
68
128
* Remote
69
129
* This is downloaded from the remote repository and contains a complete index of what is available on the remote.
70
130
71
-
## Where Are The Maven Indexes Located?
72
-
73
-
Every repository has an index under the `strongbox-vault/storages/${storageId}/${repositoryId}/.index` directory
131
+
Every repository (with enabled indexing) has an index under the `strongbox-vault/storages/${storageId}/${repositoryId}/.index` directory
* see also [MavenIndexController](https://github.com/strongbox/strongbox/blob/master/strongbox-web-core/src/main/java/org/carlspring/strongbox/controllers/layout/maven/MavenIndexController.java)
97
147
98
-
Packed indexes are either a complete compressed index, or a compressed subset of data which can be applied to an
99
-
existing index incrementally.
148
+
## How to download the packed repository index ?
100
149
101
-
### When Are Packed Indexes Generated?
150
+
Use REST API endpoint:
102
151
103
-
Packed indexes are generated when the index for a repository is rebuilt. They are not generated when a re-indexing
* see also [MavenArtifactController](https://github.com/strongbox/strongbox/blob/master/strongbox-web-core/src/main/java/org/carlspring/strongbox/controllers/layout/maven/MavenArtifactController.java)
105
154
106
155
## Information For Developers
107
156
@@ -110,7 +159,7 @@ The code for the Maven indexing is located under the [strongbox-storage-maven-la
0 commit comments