struts 2不包含文件ApplicationResources.properties

时间:2014-10-24 08:06:31

标签: java maven struts2

我有一个用struts2制作的应用程序。

几天后,当我用maven编译它时,它不包含.war文件中的ApplicationResources.properties文件。

pom.xml中的配置是:

              <execution>
                    <id>native2ascii-utf8</id>
                    <goals>
                        <goal>native2ascii</goal>
                    </goals>
                    <configuration>
                        <encoding>UTF8</encoding>
                        <includes>ApplicationResources_*.properties</includes>
                        <excludes>ApplicationResources.properties,
                            ApplicationResources_de*.properties,
                            ApplicationResources_fr*.properties,
                            ApplicationResources_nl*.properties,
                            ApplicationResources_pt*.properties,
                            ApplicationResources_es*.properties</excludes>
                    </configuration>
                </execution>
                <execution>
                    <id>native2ascii-8859_1</id>
                    <goals>
                        <goal>native2ascii</goal>
                    </goals>
                    <configuration>
                        <encoding>8859_1</encoding>
                        <includes>ApplicationResources.properties,
                            ApplicationResources_de.properties,
                            ApplicationResources_fr.properties,
                            ApplicationResources_nl.properties,
                            ApplicationResources_pt*.properties,
                            ApplicationResources_es*.properties</includes>
                    </configuration>
                </execution>

1 个答案:

答案 0 :(得分:0)

最后我解决了删除此文件的排除标记的问题

    <resource>
            <directory>src/main/resources</directory>
            <!-- <excludes>
                <exclude>ApplicationResources*.properties</exclude>
            </excludes>-->
            <filtering>true</filtering>
        </resource>