Remove UnresolvedDependenciesAnalyzer from the Gradle plugin
Closes gh-23479
This commit is contained in:
@@ -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.
|
||||
@@ -16,17 +16,12 @@
|
||||
|
||||
package org.springframework.boot.gradle.plugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.gradle.testkit.runner.BuildResult;
|
||||
import org.gradle.testkit.runner.TaskOutcome;
|
||||
import org.junit.jupiter.api.TestTemplate;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
|
||||
import org.springframework.boot.gradle.junit.GradleCompatibilityExtension;
|
||||
import org.springframework.boot.gradle.testkit.GradleBuild;
|
||||
import org.springframework.util.FileSystemUtils;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -53,19 +48,4 @@ class DependencyManagementPluginActionIntegrationTests {
|
||||
.task(":hasDependencyManagement").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
|
||||
}
|
||||
|
||||
@TestTemplate
|
||||
void helpfulErrorWhenVersionlessDependencyFailsToResolve() throws IOException {
|
||||
File examplePackage = new File(this.gradleBuild.getProjectDir(), "src/main/java/com/example");
|
||||
examplePackage.mkdirs();
|
||||
FileSystemUtils.copyRecursively(new File("src/test/java/com/example"), examplePackage);
|
||||
BuildResult result = this.gradleBuild.buildAndFail("compileJava");
|
||||
assertThat(result.task(":compileJava").getOutcome()).isEqualTo(TaskOutcome.FAILED);
|
||||
String output = result.getOutput();
|
||||
assertThat(output).contains("During the build, one or more dependencies that "
|
||||
+ "were declared without a version failed to resolve:");
|
||||
assertThat(output).contains("org.springframework.boot:spring-boot-starter-web:");
|
||||
assertThat(output).contains("Did you forget to apply the io.spring.dependency-management plugin to the "
|
||||
+ this.gradleBuild.getProjectDir().getName() + " project?");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -75,16 +75,6 @@ class SpringBootPluginIntegrationTests {
|
||||
this.gradleBuild.gradleVersion("6.3").build();
|
||||
}
|
||||
|
||||
@Test
|
||||
void unresolvedDependenciesAreAnalyzedWhenDependencyResolutionFails() throws IOException {
|
||||
createMinimalMainSource();
|
||||
BuildResult result = this.gradleBuild.buildAndFail("compileJava");
|
||||
assertThat(result.getOutput())
|
||||
.contains("During the build, one or more dependencies that were declared without a"
|
||||
+ " version failed to resolve:")
|
||||
.contains(" org.springframework.boot:spring-boot-starter:");
|
||||
}
|
||||
|
||||
private void createMinimalMainSource() throws IOException {
|
||||
File examplePackage = new File(this.gradleBuild.getProjectDir(), "src/main/java/com/example");
|
||||
examplePackage.mkdirs();
|
||||
|
||||
Reference in New Issue
Block a user