gpt4 book ai didi

java - Maven中Jetty插件的企业用途是什么?

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:02:55 25 4
gpt4 key购买 nike

自从我从一些 maven 教程中学习后,我们可以像这样将 Jetty 导入为 maven 插件。

<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.10</version>
<configuration>
<scanIntervalSeconds>5</scanIntervalSeconds>
</configuration>
</plugin>

并且可以像这样运行插件。

$ mvn jetty:run

我们还可以更改端口和上下文路径以及此插件中的许多内容。
据我了解,我们可以像tomcat一样把Jetty当作服务器,通过它来部署应用。

但我不明白的是ma​​ven中Jetty的实际企业用途是什么。

最佳答案

来自official documentation :

The Jetty Maven plugin is useful for rapid development and testing. You can add it to any webapp project that is structured according to the Maven defaults. The plugin can then periodically scan your project for changes and automatically redeploy the webapp if any are found. This makes the development cycle more productive by eliminating the build and deploy steps: you use your IDE to make changes to the project, and the running web container automatically picks them up, allowing you to test them straight away.

但是(也许这解决了您所谓的“企业用途”):

While the Jetty Maven Plugin can be very useful for development we do not recommend its use in a production capacity. In order for the plugin to work it needs to leverage many internal Maven apis and Maven itself it not a production deployment tool. We recommend either the traditional distribution deployment approach or using embedded Jetty.

关于java - Maven中Jetty插件的企业用途是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45876880/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com