在Spring Boot yml配置文件中无法使用maven变量@var@,运行报错

2019-10-23 15:55:57 浏览数 (3)

版本号:maven-resources-plugin:3.1.0

bootstrap.yml

代码语言:javascript复制
spring:
  application:
    name: system
  profiles:
    active: '@spring.active@'

pom.xml

代码语言:javascript复制
<plugins>
	<plugin>
		<groupId>org.apache.maven.plugins</groupId>
		<artifactId>maven-resources-plugin</artifactId>
		<version>3.1.0</version>
		<configuration>
		<encoding>UTF-8</encoding>
		<delimiters>
			<delimiter>@</delimiter>
		</delimiters>
		<useDefaultDelimiters>false</useDefaultDelimiters>
		</configuration>
	</plugin>
</plugins>


<resources>
	<resource>
		<directory>src/main/resources</directory>
		<filtering>true</filtering>
	</resource>
	<resource>
		<directory>src/main/java</directory>
		<includes>
			<include>**/*.xml</include>
		</includes>
	</resource>
</resources>

0 人点赞