@@ -160,7 +160,7 @@ public Configuration readJsonFile(@NotNull InputStream data) {
160
160
}
161
161
162
162
Integer version = fetchVersion (root );
163
- Set <String > repositories = fetchRepositories (root );
163
+ Set <String > repositories = fetchRepositories (root , false );
164
164
Set <Relocation > globalRelocations = fetchRelocations (root );
165
165
List <Library > libraries = fetchLibraries (root , globalRelocations );
166
166
@@ -197,11 +197,12 @@ private Integer fetchVersion(@NotNull Map<String, Object> configuration) {
197
197
* If defined, it must be an array of string representing the repository URLs.
198
198
*
199
199
* @param configuration the root object of the JSON file
200
+ * @param fallbackRepo {@code true} to fetch "fallbackRepositories" instead of "repositories"
200
201
* @return the set of repositories as strings
201
202
*/
202
- private Set <String > fetchRepositories (@ NotNull Map <String , Object > configuration ) throws ReflectiveOperationException {
203
+ private Set <String > fetchRepositories (@ NotNull Map <String , Object > configuration , boolean fallbackRepo ) throws ReflectiveOperationException {
203
204
Set <String > repos = new HashSet <>();
204
- ArrayList <Object > repositories = getArray (configuration , "repositories" );
205
+ ArrayList <Object > repositories = getArray (configuration , fallbackRepo ? "fallbackRepositories" : "repositories" );
205
206
if (repositories != null ) {
206
207
for (Object repository : repositories ) {
207
208
if (repository instanceof String ) {
@@ -423,7 +424,9 @@ private List<Library> fetchLibraries(@NotNull Map<String, Object> configuration,
423
424
424
425
fetchExcludedTransitiveDependencies (library ).forEach (libraryBuilder ::excludeTransitiveDependency );
425
426
426
- fetchRepositories (library ).forEach (libraryBuilder ::repository );
427
+ fetchRepositories (library , false ).forEach (libraryBuilder ::repository );
428
+
429
+ fetchRepositories (library , true ).forEach (libraryBuilder ::fallbackRepository );
427
430
428
431
Set <Relocation > relocations = fetchRelocations (library );
429
432
0 commit comments