Spring-boot: Gradle build error when configuring springBoot.buildInfo.additionalProperties

Created on 7 Feb 2018  路  3Comments  路  Source: spring-projects/spring-boot


Version: Spring Boot 2.0.0.RC1
Error: Could not set unknown property 'additionalProperties' for task ':myproject:bootBuildInfo' of type org.springframework.boot.gradle.tasks.buildinfo.BuildInfo.

I'm trying to set build properties like so

springBoot {
    buildInfo {
        additionalProperties = [
            'buildNumber': System.env.'BUILD_NUMBER' ?: 'UNKNOWN',
            'jobName': System.env.'JOB_NAME' ?: 'UNKNOWN'
        ]
    }
}

...following the docs as described here: https://docs.spring.io/spring-boot/docs/2.0.0.RC1/reference/htmlsingle/#howto-build-info

documentation

Most helpful comment

Thanks. I think this is a documentation issue related to the Gradle plugin changes. Try:

springBoot {
    buildInfo {
        properties {
            additional = [
                ....
            ]
        }
    }
}

All 3 comments

Thanks. I think this is a documentation issue related to the Gradle plugin changes. Try:

springBoot {
    buildInfo {
        properties {
            additional = [
                ....
            ]
        }
    }
}

That got rid of the Gradle error, thanks!

The old way works now.

Was this page helpful?
0 / 5 - 0 ratings