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:
parent
6a18ece6a2
commit
fb0d9d2a2e
|
@ -175,11 +175,11 @@ placeholders in `application.properties`, e.g.
|
|||
server.port=${port:8080}
|
||||
----
|
||||
|
||||
TIP: If you are inheriting from the `spring-boot-starter-parent` POM, or if have enabled
|
||||
maven filtering for the `application.properties` directly, you may want to change the
|
||||
default filter token from `+${*}+` since it conflicts with those placeholders.
|
||||
You can either use `+@*@+` (i.e. `@maven.token@` instead of `${maven.token}`) or you can
|
||||
configure the `maven-resources-plugin` to use
|
||||
TIP: If you are inheriting from the `spring-boot-starter-parent` POM, the default filter
|
||||
token of the `maven-resources-plugins` has been changed from `+${*}+` to `@` (i.e.
|
||||
`@maven.token@` instead of `${maven.token}`) as the former conflicts with those
|
||||
placeholders. If you have enabled the maven filtering for the `application.properties`
|
||||
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].
|
||||
|
||||
NOTE: In this specific case the port binding will work in a PaaS environment like Heroku
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?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"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -19,6 +18,7 @@
|
|||
</organization>
|
||||
<properties>
|
||||
<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.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
|
@ -50,6 +50,13 @@
|
|||
<include>**/application.properties</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>${basedir}/src/main/resources</directory>
|
||||
<excludes>
|
||||
<exclude>**/application.yml</exclude>
|
||||
<exclude>**/application.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
|
@ -103,8 +110,7 @@
|
|||
<version>2.6</version>
|
||||
<configuration>
|
||||
<delimiters>
|
||||
<!-- Provide a delimiter that doesn't clash with Spring ${} placeholders -->
|
||||
<delimiter>@</delimiter>
|
||||
<delimiter>${resource.delimiter}</delimiter>
|
||||
</delimiters>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
@ -175,22 +181,17 @@
|
|||
</goals>
|
||||
<configuration>
|
||||
<transformers>
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/spring.handlers</resource>
|
||||
</transformer>
|
||||
<transformer
|
||||
implementation="org.springframework.boot.maven.PropertiesMergingResourceTransformer">
|
||||
<transformer implementation="org.springframework.boot.maven.PropertiesMergingResourceTransformer">
|
||||
<resource>META-INF/spring.factories</resource>
|
||||
</transformer>
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
|
||||
<resource>META-INF/spring.schemas</resource>
|
||||
</transformer>
|
||||
<transformer
|
||||
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.ServicesResourceTransformer" />
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<mainClass>${start-class}</mainClass>
|
||||
</transformer>
|
||||
</transformers>
|
||||
|
|
Loading…
Reference in New Issue