简体   繁体   中英

Wildfly maven plugin not register web context

When i using wildfly maven plugin for deploy my java ee application to my wildfly 8.1.0 standalone web application server with this POM configuration:

<plugin>
    <groupId>org.wildfly.plugins</groupId>
    <artifactId>wildfly-maven-plugin</artifactId>
    <version>1.0.2.Final</version>
    <configuration>
        <hostname>127.0.0.1</hostname>
        <port>9991</port>
        <username>root</username>
        <password>manager</password>
    </configuration>
</plugin>

If i run mvn wildfly:deploy the application is deployed and i've this message from server log console:

....
21:45:42,100 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "MyApp-0.0.1.war" (runtime-name: "MyApp-0.0.1.war")
21:45:42,819 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-7) JBAS017534: Registered web context: /MyApp-0.0.1
21:45:44,319 INFO  [org.jboss.as.server] (management-handler-thread - 1) JBAS018562: Redeployed "MyApp-0.0.1.war"
....

If i specify the name parameter in configuration section of plugin into POM like this:

<plugin>
    <groupId>org.wildfly.plugins</groupId>
    <artifactId>wildfly-maven-plugin</artifactId>
    <version>1.0.2.Final</version>
    <configuration>
        <hostname>127.0.0.1</hostname>
        <port>9991</port>
        <username>root</username>
        <password>manager</password>
        <name>WebApp</name>
    </configuration>
</plugin>

the application is deployed but Web Context is not specified and if i go to: http://127.0.0.1:8080/WebApp the server show error page 404! When application is deployed with this parameter the server console log show only this message:

....
21:44:28,299 INFO  [org.jboss.as.repository] (management-handler-thread - 1) JBAS014900: Content added at location D:\Wildfly\standalone\data\content\c0\e78f2599016bf33187b1049001b210040b829a\content
21:44:28,299 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "WebApp" (runtime-name: "WebApp")
21:44:28,705 INFO  [org.jboss.as.server] (management-handler-thread - 1) JBAS018559: Redeployed "WebApp" (runtime-name : "WebApp")
....

Why, only with name specification, the web context is not registerd? Can i specify the web context in configurations parameters like the application name? Someone can help me please?

I've tried this out and it turned out that you will have to set to WebApp.war to get it working.

I would personally prefer setting the name directly in the section using the tag since this is more common and there you can omit the file extension.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM