为了简单和更容易访问,我们还在java源代码路径中保留了一些资源。这使得我们在GUI级别上作为速度模板进行开发非常方便,并且这些模板接近控制器Java代码。但是你必须告诉maven包含非java的东西,这些东西在src/main/java中,方法是在你的pom文件中添加这样的东西。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<webResources>
<resource>
<directory>src/main/java</directory>
<targetPath>WEB-INF/classes</targetPath>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
<include>**/*.htm</include>
<include>**/*.html</include>
<include>**/*.css</include>
<include>**/*.js</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>**/log4j.xml</exclude>
</excludes>
</resource>
</webResources>
</configuration>
</plugin>