1、打包跳过测试代码
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
2、打包项目源码
<plugin> <artifactId>maven-source-plugin</artifactId> <version>2.1</version> <configuration> <attach>true</attach> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin>
package范围打包
3、整合jetty插件
<plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.2.8.v20150217</version> <configuration> <scanIntervalSeconds>10</scanIntervalSeconds> <httpConnector> <port>8888</port> </httpConnector> <webApp> <contextPath>/sms</contextPath> </webApp> <war>${project.build.directory}/luna.war</war> </configuration> </plugin>
port:启动端口,contextPath:启动应用名称,scanIntervalSeconds:每隔10s钟扫描一次,war:打包项目
4、整合tomcat7插件
<plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> <configuration> <port>8888</port> <path>/luna</path> <uriEncoding>UTF-8</uriEncoding> <server>tomcat7</server> </configuration> </plugin>
全文完,感谢您的耐心阅读~
欢迎大家关注我的公众号