【问题标题】:Deploying on Wildfly using jboss-as-maven-plugin使用 jboss-as-maven-plugin 在 Wildfly 上部署
【发布时间】:2015-03-22 18:11:28
【问题描述】:

其实我真的很陌生... 每次我尝试在 Wildfly 中部署战争文件时,都会出现以下错误:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.774 s
[INFO] Finished at: 2015-03-23T01:56:20+08:00
[INFO] Final Memory: 24M/283M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.3.Fi
nal:deploy (default-cli) on project jbpm6-example: Could not execute goal deploy
 on E:\Apps\jbpm6-example\target\jbpm6-example-1.0.war. Reason: Error could not
execute operation '{
[ERROR] "address" => [],
[ERROR] "operation" => "read-attribute",
[ERROR] "name" => "launch-type"
[ERROR] }'. java.net.ConnectException: JBAS012144: Could not connect to remote:/
/localhost:9999. The connection timed out
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception

我尝试像这样在 pom.xml 中配置插件以连接到端口 9999,因为从我搜索的 Wildfly 使用端口 9990..

 <plugin>
    <groupId>org.jboss.as.plugins</groupId>
    <artifactId>jboss-as-maven-plugin</artifactId>
    <version>7.3.Final</version>

    <configuration>  
     <hostname>localhost</hostname>  
     <port>9999</port>
    </configuration>  

  </plugin>

但还是无法部署...

我也尝试过使用 wildfly-maven-plugin,但它也给了我一个错误:部署失败并被回滚

【问题讨论】:

    标签: java maven jboss


    【解决方案1】:

    旧版 jboss-as-maven-plugin 将无法与 WildFly 一起使用。您只需要使用较新的wildfly-maven-plugin。可以定义为:

    <project> ... <build> ... <plugins> ... <plugin> <groupId>org.wildfly.plugins</groupId> <artifactId>wildfly-maven-plugin</artifactId> <version>1.1.0.Alpha1</version> </plugin> ... </plugins> ... </build> ... </project>

    然后mvn wildfly:deploy 将起作用。

    这是一个提供更多详细信息的博客:

    http://blog.arungupta.me/wildfly-maven-plugin-tech-tip-9/

    https://github.com/javaee-samples/javaee7-samples 的所有 Java EE 7 示例也使用此插件。

    或者,您可以在以下位置找到使用此插件的更简单的 Java EE 7 示例:

    https://github.com/javaee-samples/javaee7-simple-sample/blob/master/pom.xml

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-03-03
      • 2012-10-09
      • 2013-05-26
      • 2020-08-25
      • 2018-03-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多