Skip to content

Commit

Permalink
Fix Spring Application compatibility on Gradle releases prior to 6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielThomas committed Feb 18, 2021
1 parent 9f9cbe0 commit 12b727a
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,16 @@ class OspackageApplicationSpringBootPlugin implements Plugin<Project> {
}
}
}
// Allow the springBoot extension configuration to propagate to the application plugin
if (!project.application.mainClass.isPresent()) {
project.application.mainClass.set(project.springBoot.mainClassName)
try {
// Allow the springBoot extension configuration to propagate to the application plugin
if (!project.application.mainClass.isPresent()) {
project.application.mainClass.set(project.springBoot.mainClassName)
}
} catch (MissingPropertyException ignore) {
// Releases prior to Gradle 6.4
if (project.application.mainClassName == null) {
project.application.mainClassName = project.springBoot.mainClassName
}
}
}
} else {
Expand Down

0 comments on commit 12b727a

Please # to comment.