简体   繁体   中英

Maven hangs after wildfly-maven-plugin:start

I have a Maven problem, I cannot quite get my head around...

My overall goal is to create integration-tests by dint of Arquillian on a WildFly 8.2.1. In order to do that, I configured the wildfly-maven-plugin as follows:


<plugin>
    <groupId>org.wildfly.plugins</groupId>
    <artifactId>wildfly-maven-plugin</artifactId>
    <version>1.0.2.Final</version>
    <executions>
        <execution>
            <id>start-wildfly-for-arquillian</id>
            <phase>pre-integration-test</phase>
            <goals>
                <goal>start</goal>
            </goals>
            <configuration>
                <jbossHome>${project.build.directory}/wildfly-8.2.1.Final</jbossHome>
                <port>49999</port>
                <jvmArgs>-Djboss.socket.binding.port-offset=40000</jvmArgs>
            </configuration>
        </execution>
        <execution>
            <id>shutdown-wildfly-for-arquillian</id>
            <phase>post-integration-test</phase>
            <goals>
                <goal>shutdown</goal>
            </goals>
            <configuration>
                <hostname>${server.ip}</hostname>
                <port>49999</port>
            </configuration>
        </execution>
    </executions>
</plugin>

So, in the 'pre-intergration-test' and 'post-intergration-test' phases, my WildFly is supposed to start and stop again...

In the 'integration-test' phase, all classes ending on 'ArquillianTest.java' shall be executed. I use the failsafe-plugin for that, as follows:


<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-failsafe-plugin</artifactId>
    <version>2.10.1</version>
    <configuration>
        <systemPropertyVariables>
            <arquillian.launch>arquillian-wildfly-as-remote</arquillian.launch>
        </systemPropertyVariables>
        <includes>
            <include>**/*ArquillianTest.java</include>
        </includes>
        <classesDirectory>
            ${target.output.directory}/WEB-INF/classes
        </classesDirectory>
    </configuration>
    <executions>
        <execution>
            <id>arquillian-tests</id>
            <phase>integration-test</phase>
            <goals>
                <goal>integration-test</goal>
            </goals>
        </execution>
    </executions>
</plugin>

The problem now is, that when I start my build process, Maven hangs after the WildFly server is started.

No deployment whatsoever has been done! It simply starts and that's it...


    [INFO] --- wildfly-maven-plugin:1.0.2.Final:start (start-wildfly-for-arquillian) @ services ---
[INFO] JAVA_HOME=/opt/oracle-jdk-bin-1.8.0.45/jre
[INFO] JBOSS_HOME=/some/path/target/wildfly-8.2.1.Final

[INFO] Server is starting up.
Oct 31, 2015 11:12:44 AM org.xnio.Xnio <clinit>
INFO: XNIO version 3.2.2.Final
Oct 31, 2015 11:12:44 AM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.2.2.Final
Oct 31, 2015 11:12:44 AM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 4.0.3.Final
[0m11:12:44,709 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.3.Final
[0m[0m11:12:44,863 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.2.Final
[0m[0m11:12:44,917 INFO  [org.jboss.as] (MSC service thread 1-6) JBAS015899: WildFly 8.2.1.Final "Tweek" starting
[0m[0m11:12:45,739 INFO  [org.jboss.as.controller.management-deprecated] (Controller Boot Thread) JBAS014627: Attribute any-ipv4-address is deprecated, and it might be removed in future version!
[0m[0m11:12:45,774 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Creating http management service using socket-binding (management-http)
[0m[0m11:12:45,791 INFO  [org.xnio] (MSC service thread 1-5) XNIO version 3.3.0.Final
[0m[0m11:12:45,797 INFO  [org.xnio.nio] (MSC service thread 1-5) XNIO NIO Implementation Version 3.3.0.Final
[0m[0m11:12:45,828 INFO  [org.jboss.remoting] (MSC service thread 1-5) JBoss Remoting version 4.0.7.Final
[0m[33m11:12:45,830 WARN  [org.jboss.as.txn] (ServerService Thread Pool -- 46) JBAS010153: Node identifier property is set to the default value. Please make sure it is unique.
[0m[0m11:12:45,830 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 45) JBAS013171: Activating Security Subsystem
[0m[0m11:12:45,831 INFO  [org.wildfly.extension.io] (ServerService Thread Pool -- 31) WFLYIO001: Worker 'default' has auto-configured to 16 core threads with 128 task threads based on your 8 available processors
[0m[0m11:12:45,831 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 40) JBAS011800: Activating Naming Subsystem
[0m[0m11:12:45,834 INFO  [org.jboss.as.security] (MSC service thread 1-10) JBAS013170: Current PicketBox version=4.0.21.Final
[0m[0m11:12:45,851 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 32) JBAS010280: Activating Infinispan subsystem.
[0m[0m11:12:45,870 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 38) JBAS012615: Activated the following JSF Implementations: [main]
[0m[0m11:12:45,875 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
[0m[0m11:12:45,897 INFO  [org.jboss.as.connector.logging] (MSC service thread 1-1) JBAS010408: Starting JCA Subsystem (IronJacamar 1.1.9.Final)
[0m[0m11:12:45,904 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-13) JBAS017502: Undertow 1.1.8.Final starting
[0m[0m11:12:45,905 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 47) JBAS017502: Undertow 1.1.8.Final starting
[0m[0m11:12:45,908 INFO  [org.jboss.as.naming] (MSC service thread 1-14) JBAS011802: Starting Naming Service
[0m[0m11:12:45,909 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-1) JBAS015400: Bound mail session [java:jboss/mail/Default]
[0m[0m11:12:45,912 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
[0m[0m11:12:45,917 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-16) JBAS010417: Started Driver service with driver-name = h2
[0m[0m11:12:46,079 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 47) JBAS017527: Creating file handler for path /some/path/target/wildfly-8.2.1.Final/welcome-content
[0m[0m11:12:46,113 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017525: Started server default-server.
[0m[0m11:12:46,118 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017531: Host default-host starting
[0m[0m11:12:46,171 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-13) JBAS017519: Undertow HTTP listener default listening on /0.0.0.0:48080
[0m[0m11:12:46,249 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-11) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
[0m[0m11:12:46,271 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-11) JBAS015012: Started FileSystemDeploymentService for directory /some/path/target/wildfly-8.2.1.Final/standalone/deployments
[0m[0m11:12:46,449 INFO  [org.jboss.ws.common.management] (MSC service thread 1-7) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.3.2.Final
[0m[0m11:12:46,511 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: Http management interface listening on http://127.0.0.1:49990/management
[0m[0m11:12:46,512 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:49990
[0m[0m11:12:46,512 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.2.1.Final "Tweek" started in 2166ms - Started 184 of 234 services (82 services are lazy, passive or on-demand)

At this point, I actually expect the integration tests to run... However, nothing happens.

In another project, I have the same configuration, except for that I used JBoss 7.1.1 there.

Would be great if anyone could give me a pointer on this...

Thanks, Walter

This is a really complicated way of doing it. Arquillian can start the container itself, and can even use different configurations and variables, see this example . It's much easier to have Arquillian do this than Maven.

Your port is wrong. The maven wildfly plugin is too lazy and does not use it to configure the instance. Instead it just uses the port setting to contact the management interface. And if that's on the default port 9990, it will consider the server not running or something stupid.

I use jboss.socket.binding.port-offset sysprop to have a different set of ports for IT so it doesn't clash with a running development instance etc. See below.

<wildfly.port>9991</wildfly.port>

                <execution>
                    <id>start-pre-integration-test</id>
                    <goals>
                        <goal>start</goal>
                    </goals>
                    <phase>pre-integration-test</phase>
                    <configuration>
                        <javaOpts>
                            <javaOpt>-Dcms.devel=true</javaOpt>
                            <javaOpt>-Djboss.socket.binding.port-offset=1</javaOpt>
                            <javaOpt>-Dhibernate.hbm2ddl.auto=update</javaOpt>
                        </javaOpts>
                    </configuration>
                </execution>

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