【问题标题】:How do I get deploy-war to work using jetty 9 maven plugin?如何使用 jetty 9 maven 插件让 deploy-war 工作?
【发布时间】:2015-07-17 21:27:21
【问题描述】:

在 jetty-9 中,mvn jetty:deploy-war 无法启动 Web 应用程序。 Maven 刚刚结束构建,而我希望它会被正在运行的码头服务器阻塞。根据日志输出,jetty maven 插件确实在端口 8080 上启动了一个连接器,并启动了 WebAppContext。不过,似乎无法将端口绑定到上下文。

重现步骤:

创建一个网络应用:mvn archetype:generate -DinteractiveMode=false -DarchetypeArtifactId=maven-archetype-webapp -DgroupId=jetty -DartifactId=jetty-demo

将此插件部分添加到 pom:

<build>
    <plugins>
        <plugin>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>9.2.10.v20150310</version>
        </plugin>
    </plugins>
    ...
</build>

执行:

mvn package

mvn jetty:deploy-war这应该启动网络应用程序然后阻塞,但它只是结束构建

使用 jetty-8 一切正常:

<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.16.v20140903</version>

注意:mvn jetty:run-war 在 jetty 9 中按预期工作。这与 deploy-war 相同,但它会触发 jetty 在部署前构建战争

参考:the jetty-9 maven plugin manual。我调试了码头启动过程,但到目前为止没有运气。

【问题讨论】:

    标签: jetty maven-jetty-plugin jetty-9


    【解决方案1】:

    The documentation you linked to tells you why.

    daemon参数设置为false会阻塞

    【讨论】:

    • 以前试过,但现在我发现我在“守护进程”中打错了。重要的是您明确需要在 jetty-9 中将其设置为 false。谢谢
    猜你喜欢
    • 1970-01-01
    • 2012-01-05
    • 2011-01-31
    • 1970-01-01
    • 2012-05-06
    • 2011-02-05
    • 2012-12-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多