gpt4 book ai didi

java - 使用 jboss-as-maven-plugin 在 Wildfly 上部署

转载 作者:太空宇宙 更新时间:2023-11-04 14:02:13 25 4
gpt4 key购买 nike

其实我对这个还很陌生...每次我尝试在 Wildfly 中部署 war 文件时,都会出现以下错误:

[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,但它也给了我一个错误:部署失败并被回滚

最佳答案

较旧的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/

所有 Java EE 7 示例位于 https://github.com/javaee-samples/javaee7-samples也使用这个插件。

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

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

关于java - 使用 jboss-as-maven-plugin 在 Wildfly 上部署,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29197999/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com