我有xml文件,其中包含必须由特定值替换的属性。所以我使用资源过滤来实现这一点。Maven资源过滤不会复制未过滤的文件
这里是资源结构:
src - main - java - resources - VAADIN -themes - UI.gwt.xml - webapp - WEB-INF
资源的pom.xml过滤用法:
<resources> <resource> <directory>${basedir}/src/main/resources</directory> <filtering>false</filtering> <includes> <include>**/VAADIN/themes/*</include> </includes> <excludes> <exclude>**/UI.gwt.xml</exclude> </excludes> </resource> <resource> <directory>${basedir}/src/main/resources</directory> <filtering>true</filtering> <includes> <include>**/UI.gwt.xml</include> </includes> <excludes> <exclude>**/VAADIN/themes/*</exclude> </excludes> </resource> </resources>
作为clean install
结果,我接收.war文件与UI.gwt.xml替换属性,但没有VAADIN /主题文件夹和它的内容。如果我对<resources>
发表评论,则VAADIN/themes将出现在.war文件中,但UI.gwt.xml没有特定的值。
我的过滤配置有什么问题?
在所示的目录结构,我看到VAADIN.themes,但是在配置我们在这两个资源VAADIN /主题。这是一个错字吗?如果不是,那很可能是问题。 – user944849
@ user944849,我使用VAADIN/themes还是VAADIN.themes并不重要。在我的IDE中显示的是没有内容的包链。但无论如何我都要重新检查。 – Dragon
@ user944849,用VAADIN.themes重新检查 - 它仍然不起作用。所以我编辑资源结构不要混淆别人。 – Dragon