1. 在maven項目的src/main/resources 中新建 META-INF/resourcescss
2. 在pom中配置插件: maven-jar-plugin 具體配置以下web
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 目錄的根目錄.apache
例: META-INF/resources/WEB-INF/jsp/test.jsp 等同 webapp/WEB-INF/jsp/test.jspapp
META-INF/resources/static/css/test.css 等同 webapp/static/css/test.csswebapp