1. 在maven项目的src/main/resources 中新建 META-INF/resources
2. 在pom中配置插件: maven-jar-plugin 具体配置如下
1 <build> 2 <plugins> 3 <plugin> 4 <groupId>org.apache.maven.plugins</groupId> 5 <artifactId>maven-jar-plugin</artifactId> 6 <version>2.4</version> 7 <configuration> 8 <archive> 9 <manifest> 10 <addDefaultImplementationEntries>true</addDefaultImplementationEntries> 11 </manifest> 12 </archive> 13 </configuration> 14 </plugin> 15 </plugins> 16 </build>
3. META-INF/resources 相当于 webapp 目录的根目录.
例: META-INF/resources/WEB-INF/jsp/test.jsp 等同 webapp/WEB-INF/jsp/test.jsp
META-INF/resources/static/css/test.css 等同 webapp/static/css/test.css