Commit 8be97fa4 authored by Dave Syer's avatar Dave Syer

Tweak docs on Maven resource filtering some more

parent d2108105
...@@ -208,19 +208,8 @@ configuration instead. This is possible in both Maven and Gradle. ...@@ -208,19 +208,8 @@ configuration instead. This is possible in both Maven and Gradle.
[[production-ready-application-info-automatic-expansion-maven]] [[production-ready-application-info-automatic-expansion-maven]]
===== Automatic property expansion using Maven ===== Automatic property expansion using Maven
You can automatically expand info properties from the Maven project using resource You can automatically expand info properties from the Maven project using resource
filtering. In your `pom.xml` you have (inside the `<build/>` element): filtering. If you use the `spring-boot-starter-parent` you can then refer to your
Maven '`project properties`' via `@..@` placeholders, e.g.
[source,xml,indent=0]
----
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
----
You can then refer to your Maven '`project properties`' via placeholders, e.g.
[source,properties,indent=0] [source,properties,indent=0]
---- ----
...@@ -229,15 +218,41 @@ You can then refer to your Maven '`project properties`' via placeholders, e.g. ...@@ -229,15 +218,41 @@ You can then refer to your Maven '`project properties`' via placeholders, e.g.
project.version=X.X.X.X project.version=X.X.X.X
project.description=Demo project for info endpoint project.description=Demo project for info endpoint
info.build.artifact=${project.artifactId} info.build.artifact=${project.artifactId}
info.build.name=${project.name} info.build.name=@project.name@
info.build.description=${project.description} info.build.description=@project.description@
info.build.version=${project.version} info.build.version=@project.version@
---- ----
NOTE: In the above example we used `+project.*+` to set some values to be used as 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. 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 `<build/>` element):
[source,xml,indent=0]
----
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
----
and (inside `<plugins/>`):
[source,xml,indent=0]
----
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<delimiters>
<delimiter>@</delimiter>
</delimiters>
</configuration>
</plugin>
----
[[production-ready-application-info-automatic-expansion-gradle]] [[production-ready-application-info-automatic-expansion-gradle]]
===== Automatic property expansion using Gradle ===== Automatic property expansion using Gradle
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment