如果管理端口不是 9990,wildfly-maven-plugin wildfly:start 会阻塞

wildfly-maven-plugin wildfly:start blocks if management-port is not 9990

wildfly:start 行为(wildfly-maven-plugin 的 Maven-Goals) 当我更改(管理-)端口(请参阅https://docs.jboss.org/wildfly/plugins/maven/latest/examples/run-example.html了解说明)。

wildfly:start 不应阻止进一步执行,而 wildfly:run 应该如此(有关说明,请参阅 https://docs.jboss.org/wildfly/plugins/maven/latest/plugin-info.html)。由于我自动发布到 JBoss-server,我希望它启动然后发布,但每当我更改管理端口时,它会阻止进一步执行(直到启动超时到期)然后构建失败。

[org.jboss.as] (Controller Boot Thread) WFLYSRV0060: HTTP-Management Interface ist empfangsbereit auf http://127.0.0.1:9990/Management

意思是 "HTTP-Management Interface is listening on http://127.0.0.1:9990/Management".

为什么它在端口 9990 上监听,即使我告诉它在端口 9995 上监听?

18:15:49,813 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: JBoss EAP 7.1.0.GA (WildFly Core 3.0.10.Final-redhat-1) wurde gestartet in 35339ms - 2625 von 2851 Diensten gestartet (379 Services sind "lazy", passiv oder werden bei Bedarf geladen)

表示“JBoss EAP 7.1.0.GA (...) 在 35339 毫秒内成功启动 - 2851 项服务中的 265 项已启动(379 项服务已启动懒惰、被动或按需启动)。

这是它挂起的消息 - 等待启动超时到期,此后失败。

这是显示问题的最小 pom.xml:

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example</groupId>
    <artifactId>test</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>test</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.install.skip>true</maven.install.skip>
        <jar.skipIfEmpty>true</jar.skipIfEmpty>

        <plugin.wildfly.port>9995</plugin.wildfly.port>
        <plugin.wildfly.httpport>8050</plugin.wildfly.httpport>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-maven-plugin</artifactId>
                <version>2.0.1.Final</version>
                <configuration>
                    <jboss-home>D:\server\jboss-eap-7.1</jboss-home>
                    <username>admin</username>
                    <password>admin</password>
                    <hostname>localhost</hostname>
                    <port>${plugin.wildfly.port}</port>
                    <java-opts>
                        <java-opt>-Djboss.http.port=${plugin.wildfly.httpport}</java-opt>
                    </java-opts>
                </configuration>
                <executions>
                    <execution>
                        <id>start-server</id>

                        <phase>integration-test</phase>
                        <goals>
                            <goal>start</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

如果我将 属性 plugin.wildfly.port 改回 9990(默认管理端口),wildfly:start 变为 再次非阻塞

如果您没有覆盖服务器配置中的管理端口,您还需要将 -Djboss.management.http.port=${plugin.wildfly.port} 作为 java-opt 传递。

还请注意,当插件尝试确定服务器是否 运行.

时,阻塞应该只持续到超时为止。