2
這裏是我的屬性文件:的Maven資源過濾不更換財產
version = ${maven.build.timestamp}
這是我的pom.xml文件看起來像:
<properties>
<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
...
<build>
<plugins>
...
</plugins>
<resources>
<resource>
<directory>${project.basedir}/src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
這是我的目錄結構看起來像:
.
├── pom.xml
├── src
│ └── main
│ ├── java
│ │ └── ...
│ ├── resources
│ │ └── application.properties
但是,當我做一個mvn clean install
並打開target/classes/application.properties
文件時,內容它仍然是一樣的:version = ${maven.build.timestamp}
爲什麼不正確地更換財產?
您可以通過方式將src/main/resources – jamierocks 2015-04-05 21:58:25