Sometimes it is useful to have an endpoint that will return your application’s maven build properties.
To set that up, there are only a few steps that need to be followed.
First, define the resource directory. By default, Maven will look in src/main/resources. Regardless, it is a good idea to add the resources and set filtering to true.
1 2 3 4 5 6 |
<resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> </resources> |
You will need to include Maven resources plugin. Using @ helps with avoiding collisions with Spring placeholders.
1 2 3 4 5 6 7 8 9 10 11 |
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>3.0.2</version> <configuration> <delimiters> <delimiter>@</delimiter> </delimiters> <useDefaultDelimiters>false</useDefaultDelimiters> </configuration> </plugin> |