Apache Maven File Management API
指定输入文件路径。我按照
In a MOJO
实例
<plugin>
<groupId>my.groupId</groupId>
<artifactId>my-maven-plugin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<executions>
<execution>
<goals>
<goal>mygoal</goal>
</goals>
<phase>generate-resources</phase>
</execution>
</executions>
<configuration>
<fileset>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>**/*.xml</include>
</includes>
</fileset>
</configuration>
</plugin>
但我无法检索文件的绝对文件路径:
public void execute() throws MojoExecutionException {
FileSetManager fileSetManager = new FileSetManager();
for (String includedFile : fileSetManager.getIncludedFiles(fileset)) {
getLog().info(includedFile);
}
}
[INFO] --- my-maven-plugin:0.0.1-SNAPSHOT:mygoal (default) ---
[INFO] some-file-A.xml
[INFO] some-file-B.xml
我也无法连接文件集。文件名为的目录,因为FileSetManager不包含检索文件集的方法。目录值。
那么,如何检索includes的绝对文件路径呢?