maven中经常使用的插件
tomcat插件:非常实用,特点就是不用配置tomcat,可以任意修改端口号。
<plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> <configuration> <!-- 指定端口 --> <port>9001</port> <!-- 请求路径 --> <path>/</path> <uriEncoding>UTF-8</uriEncoding> </configuration> </plugin>
打包插件:maven会在install的时候会把你的java文件和资源文件打包。但是有时候xml或者其他文件没打进去,造成莫名其妙的问题。这个非常实用
<resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>false</filtering> </resource> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> <filtering>false</filtering> </resource> </resources>