diff --git a/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc b/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc index 6a4b0b9cd72..7bc77f15426 100644 --- a/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc @@ -208,7 +208,25 @@ configuration instead. This is possible in both Maven and Gradle. [[production-ready-application-info-automatic-expansion-maven]] ===== Automatic property expansion using Maven You can automatically expand info properties from the Maven project using resource -filtering. In your `pom.xml` you have (inside the `` element): +filtering. If you use the `spring-boot-starter-parent` you can then refer to your +Maven '`project properties`' via `@..@` placeholders, e.g. + +[source,properties,indent=0] +---- + project.artifactId=myproject + project.name=Demo + project.version=X.X.X.X + project.description=Demo project for info endpoint + info.build.artifact=${project.artifactId} + info.build.name=@project.name@ + info.build.description=@project.description@ + info.build.version=@project.version@ +---- + +NOTE: In the above example we used `+project.*+` to set some values to be used as +fallbacks if the Maven resource filtering has not been switched on for some reason. + +NOTE: If you don't use the starter parent, in your `pom.xml` you need (inside the `` element): [source,xml,indent=0] ---- @@ -220,25 +238,22 @@ filtering. In your `pom.xml` you have (inside the `` element): ---- -You can then refer to your Maven '`project properties`' via placeholders, e.g. +and (inside ``): -[source,properties,indent=0] +[source,xml,indent=0] ---- - project.artifactId=myproject - project.name=Demo - project.version=X.X.X.X - project.description=Demo project for info endpoint - info.build.artifact=${project.artifactId} - info.build.name=${project.name} - info.build.description=${project.description} - info.build.version=${project.version} + + org.apache.maven.plugins + maven-resources-plugin + 2.6 + + + @ + + + ---- -NOTE: In the above example we used `+project.*+` to set some values to be used as -fallbacks if the Maven resource filtering has not been switched on for some reason. - - - [[production-ready-application-info-automatic-expansion-gradle]] ===== Automatic property expansion using Gradle You can automatically expand info properties from the Gradle project by configuring