@@ -121,15 +121,17 @@ void apply(Project project) {
121
121
}
122
122
123
123
private void configureJarManifestConventions (Project project ) {
124
- ExtractResources extractLegalResources = project .getTasks (). create ( "extractLegalResources" ,
125
- ExtractResources .class );
124
+ ExtractResources extractLegalResources = project .getTasks ()
125
+ . create ( "extractLegalResources" , ExtractResources .class );
126
126
extractLegalResources .getDestinationDirectory ().set (project .getLayout ().getBuildDirectory ().dir ("legal" ));
127
127
extractLegalResources .setResourcesNames (Arrays .asList ("LICENSE.txt" , "NOTICE.txt" ));
128
128
extractLegalResources .property ("version" , project .getVersion ().toString ());
129
129
SourceSetContainer sourceSets = project .getExtensions ().getByType (SourceSetContainer .class );
130
- Set <String > sourceJarTaskNames = sourceSets .stream ().map (SourceSet ::getSourcesJarTaskName )
130
+ Set <String > sourceJarTaskNames = sourceSets .stream ()
131
+ .map (SourceSet ::getSourcesJarTaskName )
131
132
.collect (Collectors .toSet ());
132
- Set <String > javadocJarTaskNames = sourceSets .stream ().map (SourceSet ::getJavadocJarTaskName )
133
+ Set <String > javadocJarTaskNames = sourceSets .stream ()
134
+ .map (SourceSet ::getJavadocJarTaskName )
133
135
.collect (Collectors .toSet ());
134
136
project .getTasks ().withType (Jar .class , (jar ) -> project .afterEvaluate ((evaluated ) -> {
135
137
jar .metaInf ((metaInf ) -> metaInf .from (extractLegalResources ));
@@ -167,8 +169,11 @@ private void configureTestConventions(Project project) {
167
169
testRetry .getFailOnPassedAfterRetry ().set (true );
168
170
testRetry .getMaxRetries ().set (isCi () ? 3 : 0 );
169
171
});
170
- project .getPlugins ().withType (JavaPlugin .class , (javaPlugin ) -> project .getDependencies ()
171
- .add (JavaPlugin .TEST_RUNTIME_ONLY_CONFIGURATION_NAME , "org.junit.platform:junit-platform-launcher" ));
172
+ project .getPlugins ()
173
+ .withType (JavaPlugin .class ,
174
+ (javaPlugin ) -> project .getDependencies ()
175
+ .add (JavaPlugin .TEST_RUNTIME_ONLY_CONFIGURATION_NAME ,
176
+ "org.junit.platform:junit-platform-launcher" ));
172
177
}
173
178
174
179
private boolean isCi () {
@@ -234,11 +239,15 @@ private void configureDependencyManagement(Project project) {
234
239
.matching ((configuration ) -> configuration .getName ().endsWith ("Classpath" )
235
240
|| JavaPlugin .ANNOTATION_PROCESSOR_CONFIGURATION_NAME .equals (configuration .getName ()))
236
241
.all ((configuration ) -> configuration .extendsFrom (dependencyManagement ));
237
- Dependency springBootParent = project .getDependencies ().enforcedPlatform (project .getDependencies ()
238
- .project (Collections .singletonMap ("path" , ":spring-boot-project:spring-boot-parent" )));
242
+ Dependency springBootParent = project .getDependencies ()
243
+ .enforcedPlatform (project .getDependencies ()
244
+ .project (Collections .singletonMap ("path" , ":spring-boot-project:spring-boot-parent" )));
239
245
dependencyManagement .getDependencies ().add (springBootParent );
240
- project .getPlugins ().withType (OptionalDependenciesPlugin .class , (optionalDependencies ) -> configurations
241
- .getByName (OptionalDependenciesPlugin .OPTIONAL_CONFIGURATION_NAME ).extendsFrom (dependencyManagement ));
246
+ project .getPlugins ()
247
+ .withType (OptionalDependenciesPlugin .class ,
248
+ (optionalDependencies ) -> configurations
249
+ .getByName (OptionalDependenciesPlugin .OPTIONAL_CONFIGURATION_NAME )
250
+ .extendsFrom (dependencyManagement ));
242
251
}
243
252
244
253
private void configureToolchain (Project project ) {
@@ -260,9 +269,9 @@ private void createProhibitedDependenciesChecks(Project project, String... confi
260
269
}
261
270
262
271
private void createProhibitedDependenciesCheck (Configuration classpath , Project project ) {
263
- CheckClasspathForProhibitedDependencies checkClasspathForProhibitedDependencies = project .getTasks (). create (
264
- "check" + StringUtils .capitalize (classpath .getName () + "ForProhibitedDependencies" ),
265
- CheckClasspathForProhibitedDependencies .class );
272
+ CheckClasspathForProhibitedDependencies checkClasspathForProhibitedDependencies = project .getTasks ()
273
+ . create ( "check" + StringUtils .capitalize (classpath .getName () + "ForProhibitedDependencies" ),
274
+ CheckClasspathForProhibitedDependencies .class );
266
275
checkClasspathForProhibitedDependencies .setClasspath (classpath );
267
276
project .getTasks ().getByName (JavaBasePlugin .CHECK_TASK_NAME ).dependsOn (checkClasspathForProhibitedDependencies );
268
277
}
0 commit comments