为什么maven-resources-plugin多次复制文件(appfuse-basic-spring-archetype v2.1.0)

时间:2012-03-19 20:12:35

标签: appfuse maven-resources-plugin

在appfuse-basic-spring-archetype v2.1.0项目上成功运行>mvn package时,控制台输出显示:

[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ ScanillionAppTier02 ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 20 resources
[INFO] Copying 16 resources
[INFO] Copying 16 resources
[INFO] Copying 16 resources

我将你的注意力转移到最后3行(复制16 ......)。我运行>mvn -X package来获取DEBUG输出,这表明资源插件声称首先过滤了16个文件,然后将它们复制两次。

更多的副本发生在分叉的hibernate3-maven-plugin:hbm2ddl部分的构建中;在该部分中,输出显示16个文件被过滤一次并复制4次。

再次,构建工作,所以我可以(应该?)计算我的祝福,避开我的眼睛,继续我的项目。唉,我走下这个老鼠洞,它会让我烦恼,直到得到答案。帮助一个人睡个好觉。 : - )

EDIT 3/19/2012 cdhabecker:更多细节

在带有-X选项的maven输出中,我发现了这个:

[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-resources-plugin:2.5:resources' with basic configurator -->
[DEBUG]   (f) buildFilters = []
[DEBUG]   (f) encoding = UTF-8
[DEBUG]   (f) escapeWindowsPaths = true
[DEBUG]   (s) includeEmptyDirs = false
[DEBUG]   (s) outputDirectory = C:\eclipse\workspace\foo\target\classes
[DEBUG]   (s) overwrite = false
[DEBUG]   (f) project = MavenProject: com.foo:foo:0.0.1-SNAPSHOT @ C:\eclipse\workspace\foo\pom.xml
[LOOK]   (s) resources = [Resource {targetPath: null, filtering: true, FileSet {directory: C:\eclipse\workspace\foo\src\main\resources, PatternSet [includes: {}, excludes: {ApplicationResources*.properties}]}}, 
[LOOK]                    Resource {targetPath: null, filtering: true, FileSet {directory: C:\eclipse\workspace\foo\target\resources, PatternSet [includes: {}, excludes: {}]}}, 
[LOOK]                    Resource {targetPath: null, filtering: false, FileSet {directory: C:\eclipse\workspace\foo\target\resources, PatternSet [includes: {}, excludes: {}]}}, 
[LOOK]                    Resource {targetPath: null, filtering: false, FileSet {directory: C:\eclipse\workspace\foo\target\resources, PatternSet [includes: {}, excludes: {}]}}]
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@eddac
[DEBUG]   (f) supportMultiLineFiltering = false
[DEBUG]   (f) useBuildFilters = true
[DEBUG]   (s) useDefaultDelimiters = true
[DEBUG] -- end configuration --

如果你看一下标有[LOOK]的行,你就会发现maven-resources认为它有4个任务(20个文件的过滤器,16个文件的过滤器,以及这16个文件的2个冗余副本) )。

所以现在我怀疑某些东西(例如,native2ascii-maven-plugin或其他插件或maven构建计划生成器)正在使用maven-resources-plugin注册这些任务,并且系统中没有任何东西需要注意一些那些任务是多余的。

0 个答案:

没有答案