【发布时间】:2014-08-02 07:20:43
【问题描述】:
我有以下pom.xml。当我运行mvn clean resources:testResources 时,我的测试资源不是filtered(在将资源中的占位符以修改后的形式放入输出文件夹之前替换它们)。为什么?
<?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>
【问题讨论】:
-
这对 op 来说可能很明显,但让我们说明什么是“过滤”:它是在将资源中的占位符(以修改后的形式)放入输出文件夹之前替换它们:Filtering
-
完成。感谢您的反馈
标签: maven maven-resources-plugin