This repository was archived by the owner on Feb 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
spring-aot-gradle-plugin/src/main/java/org/springframework/aot/gradle Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -134,10 +134,14 @@ public void apply(final Project project) {
134134 // Generated+compiled sources must be used by 'bootRun' and packaged by 'bootJar'
135135 project .getPlugins ().withType (SpringBootPlugin .class , springBootPlugin -> {
136136 Provider <RegularFile > generatedSources = generatedSourcesJar .getArchiveFile ();
137- project .getTasks ().named (SpringBootPlugin .BOOT_JAR_TASK_NAME , BootJar .class , (bootJar ) ->
138- bootJar .classpath (generatedSources ));
139- project .getTasks ().named ("bootRun" , BootRun .class , (bootRun ) ->
140- bootRun .classpath (generatedSources ));
137+ project .getTasks ().named (SpringBootPlugin .BOOT_JAR_TASK_NAME , BootJar .class , (bootJar ) -> {
138+ FileCollection existingClasspath = bootJar .getClasspath ();
139+ bootJar .setClasspath (bootJar .getProject ().files (generatedSources , new Object []{existingClasspath != null ? existingClasspath : Collections .emptyList ()}));
140+ });
141+ project .getTasks ().named ("bootRun" , BootRun .class , (bootRun ) -> {
142+ FileCollection existingClasspath = bootRun .getClasspath ();
143+ bootRun .setClasspath (bootRun .getProject ().files (generatedSources , new Object []{existingClasspath != null ? existingClasspath : Collections .emptyList ()}));
144+ });
141145 });
142146
143147 // Create a detached configuration that holds dependencies for AOT test generation
You can’t perform that action at this time.
0 commit comments