Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
15a70153
Commit
15a70153
authored
Apr 23, 2018
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.0.x'
parents
e39e125a
5ce0e07c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
6 deletions
+50
-6
SpringBootPlugin.java
.../springframework/boot/gradle/plugin/SpringBootPlugin.java
+12
-5
SpringBootPluginIntegrationTests.java
.../boot/gradle/plugin/SpringBootPluginIntegrationTests.java
+22
-1
SpringBootPluginIntegrationTests-unresolvedDependenciesAreAnalyzedWhenDependencyResolutionFails.gradle
...pendenciesAreAnalyzedWhenDependencyResolutionFails.gradle
+16
-0
No files found.
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/SpringBootPlugin.java
View file @
15a70153
...
...
@@ -30,6 +30,7 @@ import org.gradle.api.GradleException;
import
org.gradle.api.Plugin
;
import
org.gradle.api.Project
;
import
org.gradle.api.artifacts.Configuration
;
import
org.gradle.api.artifacts.ResolvableDependencies
;
import
org.gradle.util.GradleVersion
;
import
org.springframework.boot.gradle.dsl.SpringBootExtension
;
...
...
@@ -42,6 +43,7 @@ import org.springframework.boot.gradle.tasks.bundling.BootWar;
* @author Phillip Webb
* @author Dave Syer
* @author Andy Wilkinson
* @author Danny Hyun
*/
public
class
SpringBootPlugin
implements
Plugin
<
Project
>
{
...
...
@@ -120,11 +122,16 @@ public class SpringBootPlugin implements Plugin<Project> {
private
void
unregisterUnresolvedDependenciesAnalyzer
(
Project
project
)
{
UnresolvedDependenciesAnalyzer
unresolvedDependenciesAnalyzer
=
new
UnresolvedDependenciesAnalyzer
();
project
.
getConfigurations
().
all
((
configuration
)
->
configuration
.
getIncoming
()
.
afterResolve
((
resolvableDependencies
)
->
unresolvedDependenciesAnalyzer
.
analyze
(
configuration
.
getResolvedConfiguration
()
.
getLenientConfiguration
()
.
getUnresolvedModuleDependencies
())));
project
.
getConfigurations
().
all
((
configuration
)
->
{
ResolvableDependencies
incoming
=
configuration
.
getIncoming
();
incoming
.
afterResolve
((
resolvableDependencies
)
->
{
if
(
incoming
.
equals
(
resolvableDependencies
))
{
unresolvedDependenciesAnalyzer
.
analyze
(
configuration
.
getResolvedConfiguration
().
getLenientConfiguration
()
.
getUnresolvedModuleDependencies
());
}
});
});
project
.
getGradle
().
buildFinished
(
(
buildResult
)
->
unresolvedDependenciesAnalyzer
.
buildFinished
(
project
));
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/plugin/SpringBootPluginIntegrationTests.java
View file @
15a70153
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
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,6 +16,9 @@
package
org
.
springframework
.
boot
.
gradle
.
plugin
;
import
java.io.File
;
import
java.io.IOException
;
import
org.gradle.testkit.runner.BuildResult
;
import
org.junit.Rule
;
import
org.junit.Test
;
...
...
@@ -51,4 +54,22 @@ public class SpringBootPluginIntegrationTests {
this
.
gradleBuild
.
gradleVersion
(
"4.0"
).
build
();
}
@Test
public
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
();
new
File
(
examplePackage
,
"Application.java"
).
createNewFile
();
}
}
spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/resources/org/springframework/boot/gradle/plugin/SpringBootPluginIntegrationTests-unresolvedDependenciesAreAnalyzedWhenDependencyResolutionFails.gradle
0 → 100644
View file @
15a70153
buildscript
{
dependencies
{
classpath
files
(
pluginClasspath
.
split
(
','
))
}
}
apply
plugin:
'org.springframework.boot'
apply
plugin:
'java'
repositories
{
flatDir
{
dirs
'libs'
}
}
dependencies
{
compile
'org.springframework.boot:spring-boot-starter'
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment