以自己之前写的mgblog项目为例,加入jetty容器插件来运行,并发布到私服中。
Pom.xml中配置代码:
<span style="white-space:pre"> </span><plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.6</version>
<configuration>
<encoding>UTF-8</encoding>
<scanIntervalSeconds>10</scanIntervalSeconds>
<contextPath>mgblog</contextPath>
</configuration>
</plugin>
还有很多属性可以配置,这里就不详细介绍了。具体推荐去学习一下jetty。
运行mvn jetty:run