【发布时间】:2016-01-12 14:58:56
【问题描述】:
我可以像这样使用 pom.xml 中的jetty-maven-plugin 配置成功配置和启动嵌入式码头,
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<stopKey>webappStop</stopKey>
<stopPort>9191</stopPort>
<httpConnector>
<host>localhost</host>
<port>9090</port>
</httpConnector>
</configuration>
</plugin>
我可以右键单击项目并运行 maven 目标,jetty:run,项目开始在端口 9090 上运行,
[INFO] jetty-9.3.0.M1
[INFO] No Spring WebApplicationInitializer types detected on classpath
[INFO] Started ServerConnector@1023a4c5{HTTP/1.1,[http/1.1]}{localhost:9090}
[INFO] Started @8012ms
[INFO] Started Jetty Server
现在我需要为服务器启动和停止命令编写一个 Ant 任务,而不是每次都右键单击并运行 maven 目标。
【问题讨论】:
标签: ant embedded-jetty maven-jetty-plugin