File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
buildSrc/src/main/java/org/springframework/boot/build/context/properties Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 23
23
24
24
import org .gradle .api .Plugin ;
25
25
import org .gradle .api .Project ;
26
+ import org .gradle .api .Task ;
26
27
import org .gradle .api .artifacts .Configuration ;
27
28
import org .gradle .api .plugins .JavaPlugin ;
28
29
import org .gradle .api .plugins .JavaPluginConvention ;
37
38
*
38
39
* <ul>
39
40
* <li>Adding a dependency on the configuration properties annotation processor.
40
- * <li>Configure the additional metadata locations annotation processor compiler argument
41
+ * <li>Configuring the additional metadata locations annotation processor compiler
42
+ * argument.
43
+ * <li>Adding the outputs of the processResources task as inputs of the compileJava task
44
+ * to ensure that the additional metadata is available when the annotation processor runs.
41
45
* <li>Defining an artifact for the resulting configuration property metadata so that it
42
46
* can be consumed by downstream projects.
43
47
* </ul>
@@ -83,6 +87,7 @@ private void addMetadataArtifact(Project project) {
83
87
private void configureAdditionalMetadataLocationsCompilerArgument (Project project ) {
84
88
JavaCompile compileJava = project .getTasks ().withType (JavaCompile .class )
85
89
.getByName (JavaPlugin .COMPILE_JAVA_TASK_NAME );
90
+ ((Task ) compileJava ).getInputs ().files (project .getTasks ().getByName (JavaPlugin .PROCESS_RESOURCES_TASK_NAME ));
86
91
SourceSet mainSourceSet = project .getConvention ().getPlugin (JavaPluginConvention .class ).getSourceSets ()
87
92
.getByName (SourceSet .MAIN_SOURCE_SET_NAME );
88
93
compileJava .getOptions ().getCompilerArgs ()
You can’t perform that action at this time.
0 commit comments