在Spring Boot yml配置文件中沒法使用maven變量@var@,運行報錯

版本號:maven-resources-plugin:3.1.0java

bootstrap.ymlspring

spring:
  application:
    name: system
  profiles:
    active: '@spring.active@'

pom.xmlapache

<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>
相關文章
相關標籤/搜索