Reputation: 23
For some reason when trying to build spring boot application using gradle with Jenkins, I'm getting the following error:
What went wrong: A problem occurred evaluating root project 'ProjectName'.
The error encountered is as follows:
Could not set unknown property 'archiveFileName' for task ':bootJar' of type org.springframework.boot.gradle.tasks.bundling.BootJar.
Any help?
Thanks
Upvotes: 2
Views: 8073
Reputation: 7598
The property archiveFileName
on tasks of type jar
(and thereby also on the bootJar
task`) was introduced in Gradle 5.2, so you are most likely running on an older version of Gradle.
The property is either something you (or another maintainer of the project) has set directly in a build.gradle
file, or it is set as part of the Spring Boot plugin implementation.
First of all, make sure you are using a version of Spring Boot that is compatible with the version of Gradle you are using. For the current release of Spring Boot, you can find the requirements here. If you use an older version, be sure to check the docs for that particular version. For reference, here is what they say about Spring Boot version 2.3.3:
Spring Boot’s Gradle plugin requires Gradle 6 (6.3 or later). Gradle 5.6 is also supported but this support is deprecated and will be removed in a future release.
Secondly, be sure you are using the Gradle wrapper (gradlew
with a 'w') instead of a system wide installation (just gradle
). This ensures you are running the same version of Gradle that the project was created for. If you need to upgrade or downgrade Gradle, read this. Of cause, whatever DSL you use in the gradle files need to be compatible with the version of Gradle configured in the wrapper.
Upvotes: 3