Maven在野蛮之后挂起

我有一个Maven问题,我无法理解我的头...

我的总体目标是通过在WildFly 8.2.1上使用Arquillian创建集成测试。 为了做到这一点,我配置了wildfly-maven-plugin,如下所示:


<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>

因此,在“预集成测试”和“后集成测试”阶段,我的WildFly应该再次启动并停止......

在“集成测试”阶段,所有以“ArquillianTest.java”结尾的类都将被执行。 我使用故障安全插件,如下所示:


<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>

现在的问题是,当我开始构建过程时,Maven会在WildFly服务器启动后挂起。

没有任何部署已经完成! 它只是开始,就是这样...


    [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)

在这一点上,我实际上期望集成测试运行...但是,没有任何反应。

在另一个项目中,除了我在那里使用JBoss 7.1.1以外,我拥有相同的配置。

如果有人能给我一个指针,这将是伟大的...

谢谢,沃尔特


这是一个非常复杂的方式。 Arquillian可以启动容器本身,甚至可以使用不同的配置和变量,请参阅此示例。 Arquillian比Maven更容易做到这一点。


你的端口是错误的。 maven wildfly插件太懒,不会用它来配置实例。 相反,它只是使用端口设置来联系管理界面。 如果这是在默认端口9990上,它会认为服务器没有运行或者是一些愚蠢的东西。

我使用jboss.socket.binding.port-offset sysprop为IT部署了一组不同的端口,因此它不会与正在运行的开发实例发生冲突等。请参见下文。

<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>
链接地址: http://www.djcxy.com/p/60665.html

上一篇: Maven hangs after wildfly

下一篇: ERROR [WsdlTestCase] Failed to create test step for [X]