Skip to content

Commit 709db55

Browse files
committed
Ensure that classes and resources are in place before documenting
Closes gh-25948
1 parent d7b43a3 commit 709db55

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

buildSrc/src/main/java/org/springframework/boot/build/autoconfigure/AutoConfigurationPlugin.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2020 the original author or authors.
2+
* Copyright 2019-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -66,8 +66,10 @@ public void apply(Project project) {
6666
.add(project.getDependencies().project(Collections.singletonMap("path",
6767
":spring-boot-project:spring-boot-tools:spring-boot-configuration-processor")));
6868
project.getTasks().create("autoConfigurationMetadata", AutoConfigurationMetadata.class, (task) -> {
69-
task.setSourceSet(project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets()
70-
.getByName(SourceSet.MAIN_SOURCE_SET_NAME));
69+
SourceSet main = project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets()
70+
.getByName(SourceSet.MAIN_SOURCE_SET_NAME);
71+
task.setSourceSet(main);
72+
task.dependsOn(main.getClassesTaskName());
7173
task.setOutputFile(new File(project.getBuildDir(), "auto-configuration-metadata.properties"));
7274
project.getArtifacts().add(AutoConfigurationPlugin.AUTO_CONFIGURATION_METADATA_CONFIGURATION_NAME,
7375
project.provider((Callable<File>) task::getOutputFile), (artifact) -> artifact.builtBy(task));

0 commit comments

Comments
 (0)