2014-12-03 45 views
0

我們提供以下信息春天引導信息終點

info: 
    build: 
     artifact: ${project.artifactId} 
     name: ${project.name} 
     description: ${project.description} 
     version: ${project.version} 

當我們訪問通過MVN彈簧開機/信息終點有application.yml:運行,我們看到下面的

"build": { 
    "artifact": "${project.artifactId}", 
    "version": "${project.version}", 
    "name": "${project.name}", 
    "description": "${project.description}" 
}, 

這些值未被替換。

標準春季啓動的Maven已經濾波開啓

<resources> 
     <resource> 
      <directory>src/main/resources</directory> 
      <filtering>true</filtering> 
     </resource> 
    </resources> 

POM默認完成過濾工作YML文件?

+0

什麼版本的Spring Boot?你是否使用spring-boot-starter-parent作爲父pom? – 2014-12-03 14:54:57

回答

0

我無法複製這個,我使用了相同的配置,並填充了值。正如Dave Syer所說,我的父母pom的確有以下價值:

<parent> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-parent</artifactId> 
    <version>1.2.3.RELEASE</version> 
    <relativePath/> <!-- lookup parent from repository --> 
</parent>