Enable opt-in use of mavenLocal() for dependency resolution

This commit is contained in:
Andy Wilkinson
2022-09-05 17:52:33 +01:00
parent 641e2bdc2b
commit dd1df03a4f

View File

@@ -20,6 +20,7 @@ import java.net.URI;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.stream.Stream;
import com.avast.gradle.dockercompose.ComposeExtension;
import com.avast.gradle.dockercompose.ComposeSettings;
@@ -70,6 +71,12 @@ public class AotSmokeTestPlugin implements Plugin<Project> {
SourceSet aotTest = javaExtension.getSourceSets().create("aotSmokeTest");
javaExtension.setSourceCompatibility(JavaVersion.VERSION_17);
javaExtension.setTargetCompatibility(JavaVersion.VERSION_17);
if (project.hasProperty("fromMavenLocal")) {
String fromMavenLocal = project.property("fromMavenLocal").toString();
Stream<String> includedGroups = Stream.of(fromMavenLocal.split(","));
project.getRepositories().mavenLocal(
(mavenLocal) -> mavenLocal.content((content) -> includedGroups.forEach(content::includeGroup)));
}
project.getRepositories().mavenCentral();
project.getRepositories().maven((repo) -> {
repo.setName("Spring Milestone");