Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
2ba2cfe2
Commit
2ba2cfe2
authored
Sep 15, 2014
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document build-time property expansion using Gradle
Closes gh-1540
parent
3c815f40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
3 deletions
+37
-3
production-ready-features.adoc
...oot-docs/src/main/asciidoc/production-ready-features.adoc
+37
-3
No files found.
spring-boot-docs/src/main/asciidoc/production-ready-features.adoc
View file @
2ba2cfe2
...
...
@@ -195,9 +195,20 @@ exposed. For example, you could add the following to your `application.propertie
info.app.version=1.0.0
----
If you are using Maven, you can automatically expand info properties from the Maven
project using resource filtering. In your `pom.xml` you have (inside the `<build/>`
element):
[[production-ready-application-info-automatic-expansion]]
==== Automatically expand info properties at build time
Rather than hardcoding some properties that are also specified in your project'
s
build
configuration
,
you
can
automatically
expand
info
properties
using
the
existing
build
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
`<
build
/>`
element
):
[
source
,
xml
,
indent
=
0
]
----
...
...
@@ -228,6 +239,29 @@ fallbacks if the Maven resource filtering has not been switched on for some reas
[[
production
-
ready
-
application
-
info
-
automatic
-
expansion
-
gradle
]]
=====
Automatic
property
expansion
using
Gradle
You
can
automatically
expand
info
properties
from
the
Gradle
project
by
configuring
the
Java
plugin
's `processResources` task to do so:
[source,groovy,indent=0]
----
processResources {
expand(project.properties)
}
----
You can then refer to your Gradle project'
s
properties
via
placeholders
,
e
.
g
.
[
source
,
properties
,
indent
=
0
]
----
info
.
build
.
name
=${
name
}
info
.
build
.
description
=${
description
}
info
.
build
.
version
=${
version
}
----
[[
production
-
ready
-
git
-
commit
-
information
]]
====
Git
commit
information
Another
useful
feature
of
the
`
info
`
endpoint
is
its
ability
to
publish
information
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment