11

我正在将构建部署到本地和远程 Jboss AS 7.1.1 Final 的端口 9999。Maven 使用 jboss 插件“jboss-as-maven-plugin:7.1.1.Final”来管理服务器的构建。我已经确认服务器已启动并正在运行,并且端口可在 9999 访问。但是“多次”构建失败,本地和远程 Jboss 都出现以下错误。Jboss ic 配置为 Standalone 模式的单节点集群。

扼杀构建不会每次都失败,但大多数时候都会失败。不确定我们是否需要将 Maven 插件升级到更高版本。

[INFO] ohmehMavenExecutionResultHandler - 构建失败并出现异常 [INFO] ohmehMavenExecutionResultHandler - [1] org.apache.maven.lifecycle.LifecycleExecutionException: 无法执行目标 org.jboss.as.plugins:jboss-as-maven-plugin: 7.1.1.Final:undeploy (default-cli) on project Test: Error execution UNDEPLOY [DEBUG] Closing connection to remote [ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.1 .1.Final:undeploy (default-cli) on project Test: Error execution UNDEPLOY: java.net.ConnectException: JBAS012144: could not connect to remote://localhost:9999. 连接超时 -> [帮助 1]

更新

<plugin>
   <groupId>org.jboss.as.plugins</groupId>
   <artifactId>jboss-as-maven-plugin</artifactId>
   <version>7.1.1.Final</version>
   <configuration>
     <filename>${project.build.finalName}.jar</filename>
     <username>${userName}</username>
     <password>${password}</password>
   </configuration>
</plugin>

我现在正在使用最新版本的 Maven 插件,但现在连接超时错误似乎更加频繁。我开始考虑 Jboss 在尝试使用应用程序的不同子项目进行过多远程部署时是否表现不同。我从主 POM 部署了 21 个子项目。示例配置如下

<project xmlns="http://maven.apache.org/POM/4.0.0" 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.master</groupId>
    <artifactId>master</artifactId>
    <version>1.0.0</version>
    <packaging>pom</packaging>
    <name>Master</name>
    <url>http://maven.apache.org</url>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <modules>
        <module>module1</module>
        <module>module2</module>
        <module>module3</module>
        <module>module4</module>
        <module>module5</module>
        <module>module6</module>
        <module>module7</module>
        <module>module8</module>
        <module>module9</module>
        <module>module10</module>
        <module>module11</module>
        <module>module12</module>
        <module>module13</module>
    </modules>
4

2 回答 2

1

首先,检查插件配置。例如:

    <plugin>
        <groupId>org.jboss.as.plugins</groupId>
        <artifactId>jboss-as-maven-plugin</artifactId>
        <version>7.9.Final</version>
        <inherited>true</inherited>
        <configuration>
            <hostname>${jboss.hostname}</hostname>
            <port>${jboss.port}</port>
            <username>${jboss.user}</username>
            <password>${jboss.pass}</password>
            <timeout>30000</timeout>
        </configuration>
    </plugin>

如果主机名、端口号(默认 9999)、用户名和密码都可以,可以尝试增加“超时”(默认为 5000 毫秒,您可以尝试使用 30000 毫秒)。它对我有用。

于 2017-12-16T01:46:37.760 回答
0

4个可能的问题解决方案

  1. 删除您的本地缓存设置,这将是您的本地 m2 存储库或从您的 maven settings.xml 文件中指向新的 m2 存储库。
  2. 尝试使用相关/适当的凭据连接到您的本地 nexus/archiva(如果有的话)。这只是您的 Maven 插件导致此问题。
  3. 尝试使用此链接中提供的最新 JBoss Deploy 插件。

  4. 或者检查您的 windows/Linux 防火墙设置是否已启用。

于 2016-01-22T09:10:04.427 回答