Fix build failure

This commit reworks a7e1ec8 to fix the build failure and update the
documentation regarding default maven filtering option with
spring-boot-starter-parent

Fixes gh-1199
This commit is contained in:
Stephane Nicoll 2014-11-03 14:01:51 +01:00
parent 6a18ece6a2
commit fb0d9d2a2e
2 changed files with 20 additions and 19 deletions

View File

@ -175,11 +175,11 @@ placeholders in `application.properties`, e.g.
server.port=${port:8080} server.port=${port:8080}
---- ----
TIP: If you are inheriting from the `spring-boot-starter-parent` POM, or if have enabled TIP: If you are inheriting from the `spring-boot-starter-parent` POM, the default filter
maven filtering for the `application.properties` directly, you may want to change the token of the `maven-resources-plugins` has been changed from `+${*}+` to `@` (i.e.
default filter token from `+${*}+` since it conflicts with those placeholders. `@maven.token@` instead of `${maven.token}`) as the former conflicts with those
You can either use `+@*@+` (i.e. `@maven.token@` instead of `${maven.token}`) or you can placeholders. If you have enabled the maven filtering for the `application.properties`
configure the `maven-resources-plugin` to use directly, you may want to change the default filter token to use
http://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html#delimiters[other delimiters]. http://maven.apache.org/plugins/maven-resources-plugin/resources-mojo.html#delimiters[other delimiters].
NOTE: In this specific case the port binding will work in a PaaS environment like Heroku NOTE: In this specific case the port binding will work in a PaaS environment like Heroku

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@ -19,6 +18,7 @@
</organization> </organization>
<properties> <properties>
<java.version>1.6</java.version> <java.version>1.6</java.version>
<resource.delimiter>@</resource.delimiter> <!-- delimiter that doesn't clash with Spring ${} placeholders -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.source>${java.version}</maven.compiler.source>
@ -50,6 +50,13 @@
<include>**/application.properties</include> <include>**/application.properties</include>
</includes> </includes>
</resource> </resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
<excludes>
<exclude>**/application.yml</exclude>
<exclude>**/application.properties</exclude>
</excludes>
</resource>
</resources> </resources>
<pluginManagement> <pluginManagement>
<plugins> <plugins>
@ -103,8 +110,7 @@
<version>2.6</version> <version>2.6</version>
<configuration> <configuration>
<delimiters> <delimiters>
<!-- Provide a delimiter that doesn't clash with Spring ${} placeholders --> <delimiter>${resource.delimiter}</delimiter>
<delimiter>@</delimiter>
</delimiters> </delimiters>
</configuration> </configuration>
</plugin> </plugin>
@ -175,22 +181,17 @@
</goals> </goals>
<configuration> <configuration>
<transformers> <transformers>
<transformer <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource> <resource>META-INF/spring.handlers</resource>
</transformer> </transformer>
<transformer <transformer implementation="org.springframework.boot.maven.PropertiesMergingResourceTransformer">
implementation="org.springframework.boot.maven.PropertiesMergingResourceTransformer">
<resource>META-INF/spring.factories</resource> <resource>META-INF/spring.factories</resource>
</transformer> </transformer>
<transformer <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource> <resource>META-INF/spring.schemas</resource>
</transformer> </transformer>
<transformer <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" /> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>${start-class}</mainClass> <mainClass>${start-class}</mainClass>
</transformer> </transformer>
</transformers> </transformers>