16
我有以下pom.xml
。當我運行mvn clean resources:testResources
時,我的測試資源未被過濾。爲什麼?如何過濾maven中的測試資源?
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>foo</artifactId>
<version>0.0.1</version>
<packaging>jar</packaging>
<name>foo</name>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>
另一個Maven的subtility ... – Stephan
@Stephan似乎相當不錯的主意分離資源和測試資源沒有? –
@MichaelLaffargue你是對的。然而,OP在他的問題中嘗試的方式更爲明顯。 – Stephan