通过 SSL 的 wildfly-maven-plugin 部署工作一次 "connection error"

wildfly-maven-plugin deployment over SSL works once then "connection error"

在确保 Wildfly 管理控制台安全以使用 HTTPS 并将我的 pom.xml 配置为通过 https 部署后,我遇到了一个奇怪的行为。 (我试过版本 8.2.1 和 10.1.0,独立模式)。

我只能(重新)部署一次成功。之后,我收到以下错误,我必须重新启动服务器才能再次(重新)部署:

pom.xml的变化:

    <plugin>
        <groupId>org.wildfly.plugins</groupId>
        <artifactId>wildfly-maven-plugin</artifactId>
        <version>1.0.2.Final</version>  
        <configuration>
            <protocol>https-remoting</protocol>
            <port>9993</port> 
        </configuration>        
    </plugin>

在我的完全独立 ha.xml 中,我添加了 server-identities 并编辑了 socket-binding

    <management>
        <security-realms>
            <security-realm name="ManagementRealm">
                <server-identities>
                    <ssl>
                        <keystore path="server-keystore.jks" relative-to="jboss.server.config.dir" keystore-password="mypassword"/>
                    </ssl>
                </server-identities>
...
        <management-interfaces>
            <http-interface security-realm="ManagementRealm" http-upgrade-enabled="true">
                <socket-binding http="management-http" https="management-https"/>
            </http-interface>
        </management-interfaces>

我在执行 mvn 之前添加了信任库:

> set MAVEN_OPTS=-Djavax.net.ssl.trustStore=C:/pathto/client-truststore -Djavax.net.ssl.trustStorePassword=mypassword

连接在后续执行时超时。这是错误:

    > mvn wildfly:deploy -e (OR mvn wildfly:redeploy -e)  

    [INFO] BUILD FAILURE
    ...
    [ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final:redeploy (default-cli) on project xyz-project-web: Could not execute goal redeploy on C:\projects\abc\xyz-project\trunk\xyz-project-web\target\xyz-project-web-0-SNAPSHOT.war. Reason: I/O Error could not execute operation '{
    [ERROR] "operation" => "read-attribute",
    [ERROR] "address" => [],
    [ERROR] "name" => "launch-type"
    [ERROR] }': java.net.ConnectException: JBAS012144: Could not connect to https-remoting://172.31.100.26:9993. 
The connection timed out
    [ERROR] -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final:redeploy (default-cli) 
    on project xyz-project-web: Could not execute goal redeploy on C:\projects\abc\xyz-project\trunk\xyz-project-web\target\xyz-project-web-0-SNAPSHOT.war. Reason: I/O
    Error could not execute operation '{
        "operation" => "read-attribute",
        "address" => [],
        "name" => "launch-type"
    }'
    ...
            at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
    Caused by: org.apache.maven.plugin.MojoExecutionException: Could not execute goal redeploy on C:\projects\abc\xyz-project\trunk\xyz-project-web\target\
    test-project-web-0-SNAPSHOT.war. Reason: I/O Error could not execute operation '{
        "operation" => "read-attribute",
        "address" => [],
        "name" => "launch-type"
    }'
    ...
            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
            ... 20 more
    Caused by: java.lang.IllegalStateException: I/O Error could not execute operation '{
        "operation" => "read-attribute",
        "address" => [],
        "name" => "launch-type"
    }'
    ...
            at org.wildfly.plugin.deployment.AbstractDeployment.doExecute(AbstractDeployment.java:136)
            ... 24 more
    Caused by: java.io.IOException: java.net.ConnectException: JBAS012144: Could not connect to https-remoting://172.31.100.26:9993. The connection timed out
            at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:129)
            ... 28 more
    Caused by: java.net.ConnectException: JBAS012144: Could not connect to https-remoting://172.31.100.26:9993. The connection timed out
            at org.jboss.as.protocol.ProtocolConnectionUtils.connectSync(ProtocolConnectionUtils.java:119)
    ...
            at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:127)
            ... 30 more

第一次执行后我找不到任何相关的变化。

这看起来像是旧版本中的错误。我升级到 wildfly-maven-plugin 1.2.1.Final,现在可以正常工作了。