|
|
@ -30,6 +30,7 @@ import org.gradle.api.GradleException;
|
|
|
|
import org.gradle.api.Plugin;
|
|
|
|
import org.gradle.api.Plugin;
|
|
|
|
import org.gradle.api.Project;
|
|
|
|
import org.gradle.api.Project;
|
|
|
|
import org.gradle.api.artifacts.Configuration;
|
|
|
|
import org.gradle.api.artifacts.Configuration;
|
|
|
|
|
|
|
|
import org.gradle.api.artifacts.ResolvableDependencies;
|
|
|
|
import org.gradle.util.GradleVersion;
|
|
|
|
import org.gradle.util.GradleVersion;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.boot.gradle.dsl.SpringBootExtension;
|
|
|
|
import org.springframework.boot.gradle.dsl.SpringBootExtension;
|
|
|
@ -42,6 +43,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootWar;
|
|
|
|
* @author Phillip Webb
|
|
|
|
* @author Phillip Webb
|
|
|
|
* @author Dave Syer
|
|
|
|
* @author Dave Syer
|
|
|
|
* @author Andy Wilkinson
|
|
|
|
* @author Andy Wilkinson
|
|
|
|
|
|
|
|
* @author Danny Hyun
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public class SpringBootPlugin implements Plugin<Project> {
|
|
|
|
public class SpringBootPlugin implements Plugin<Project> {
|
|
|
|
|
|
|
|
|
|
|
@ -120,11 +122,16 @@ public class SpringBootPlugin implements Plugin<Project> {
|
|
|
|
|
|
|
|
|
|
|
|
private void unregisterUnresolvedDependenciesAnalyzer(Project project) {
|
|
|
|
private void unregisterUnresolvedDependenciesAnalyzer(Project project) {
|
|
|
|
UnresolvedDependenciesAnalyzer unresolvedDependenciesAnalyzer = new UnresolvedDependenciesAnalyzer();
|
|
|
|
UnresolvedDependenciesAnalyzer unresolvedDependenciesAnalyzer = new UnresolvedDependenciesAnalyzer();
|
|
|
|
project.getConfigurations().all((configuration) -> configuration.getIncoming()
|
|
|
|
project.getConfigurations().all((configuration) -> {
|
|
|
|
.afterResolve((resolvableDependencies) -> unresolvedDependenciesAnalyzer
|
|
|
|
ResolvableDependencies incoming = configuration.getIncoming();
|
|
|
|
.analyze(configuration.getResolvedConfiguration()
|
|
|
|
incoming.afterResolve((resolvableDependencies) -> {
|
|
|
|
.getLenientConfiguration()
|
|
|
|
if (incoming.equals(resolvableDependencies)) {
|
|
|
|
.getUnresolvedModuleDependencies())));
|
|
|
|
unresolvedDependenciesAnalyzer.analyze(configuration
|
|
|
|
|
|
|
|
.getResolvedConfiguration().getLenientConfiguration()
|
|
|
|
|
|
|
|
.getUnresolvedModuleDependencies());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
project.getGradle().buildFinished(
|
|
|
|
project.getGradle().buildFinished(
|
|
|
|
(buildResult) -> unresolvedDependenciesAnalyzer.buildFinished(project));
|
|
|
|
(buildResult) -> unresolvedDependenciesAnalyzer.buildFinished(project));
|
|
|
|
}
|
|
|
|
}
|
|
|
|