0

Having migrated from Spring Boot 1.5.19 to Spring Boot 2.0.4, we are encountering problems with the build on jenkins. Using gradle 4.2.1. We think the behavioural changes in the spring boot gradle plugin between the versions is causing our issue.

The spring Boot gradle plugin has also been updated from 1.5.19 to 2.0.4

Our target artefact naming convention is :

project-name-<version>-<branch>-RELEASE.jar

The jar file gets generated correctly, having specified the following in the build.gradle file.

bootJar {
    baseName = 'project_name'
}

The problem occurs when the uploadArchives task is executed. This task looks for an artefact with the following naming convention.

<path-folder-name>-<version>-<branch>-RELEASE.jar

where is the name of the folder path on the jenkins.

It doesn’t seem to be picking up the baseName config.

The build pipeline runs successfully when we don’t perform the uploadArchives task. Also, prior to the Spring Boot upgrade, this was not an issue.

Is there a way to get uploadArchives task to look for the generated jar file name?

vandekerkoff
  • 415
  • 8
  • 24

1 Answers1

0

I resolved this eventually by adding a settings.gradle file and defining a a root project name in that

rootProject.name = "project_name"

I think the upgrading of the spring Boot gradle plugin must have changed the way the project was being defined.

The 1.5.* version seemed to be taking the project name from the baseName in the Jar task, but the newer version was using the folder name where the app sits.

That was fun

vandekerkoff
  • 415
  • 8
  • 24