如何通过wildfly-maven-plugin运行WildFly服务器服务?

时间:2016-07-22 07:25:58

标签: java maven wildfly wildfly-10

我尝试使用wildfly-maven-plugin来构建示例服务。 源代码是:

https://github.com/wildfly/quickstart/tree/10.x/helloworld-html5

我想在maven pom.xml中简单地使用wildfly-maven-plugin:

         <plugin>
            <groupId>org.wildfly.plugins</groupId>
            <artifactId>wildfly-maven-plugin</artifactId>
            <version>1.1.0.Alpha10</version>
        </plugin>

构建测试服务器,如命令:

 mvn wildfly:run

运行服务器。

我可以找到README.md 但写的网址似乎不对。

我测试链接:

http://localhost:8080/jboss-helloworld-html5/hello/json/YOUR_NAME

http://localhost:8080/hello/json/YOUR_NAME

所有人都给我404错误。

它出了什么问题?

如何制作mvn wildfly:运行可以运行这个项目吗?

1 个答案:

答案 0 :(得分:0)

正如Gimby所说,您的上下文路径应为wildfly-helloworld-html5。看起来README不正确。该网址应为http://localhost:8080/wildfly-helloworld-html5/hello/xml/YOUR_NAMEhttp://localhost:8080/wildfly-helloworld-html5/hello/json/YOUR_NAME

此外,当您启动时,您应该在控制台上看到如下所示的日志消息。

08:22:18,281 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 58) WFLYUT0021: Registered web context: /wildfly-helloworld-html5

这将为您提供已注册的上下文。

相关问题