Add support for repository mapping

This commit adds a way to map the repository of a dependency based on
a compatibility range.

Closes gh-1085
This commit is contained in:
Stephane Nicoll
2020-05-15 17:58:49 +02:00
parent 374459f800
commit a8926c2da7
6 changed files with 89 additions and 48 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -55,8 +55,9 @@ class DefaultDependencyMetadataProviderTests {
void resolveDependencies() {
Dependency first = Dependency.withId("first", "org.foo", "first");
first.getMappings().add(Dependency.Mapping.create("[1.0.0.RELEASE, 1.1.0.RELEASE)", "org.bar", "second",
"0.1.0.RELEASE", null));
first.getMappings().add(Dependency.Mapping.create("1.1.0.RELEASE", "org.biz", "third", "0.2.0.RELEASE", null));
"0.1.0.RELEASE", null, null));
first.getMappings()
.add(Dependency.Mapping.create("1.1.0.RELEASE", "org.biz", "third", "0.2.0.RELEASE", null, null));
Dependency second = Dependency.withId("second", "org.foo", "second");
InitializrMetadata metadata = InitializrMetadataTestBuilder.withDefaults()
.addDependencyGroup("test", first, second).build();