Jenkins Wildfly部署

时间:2018-06-12 09:17:50

标签: jenkins deployment jboss wildfly

我想从jenkins向warfly部署war文件。我尝试了很多方法,但它对我不起作用

  • 我使用了部署WAR / EAR到wildfly插件,但它不适用于我,我收到了错误:
  

(致命:无法初始化命令上下文。构建步骤'部署   WAR / EAR到WildFly'标记为构建失败完成:失败),

我搜索了这个问题,给出的答案对我没有帮助。

  • 在我使用Deploy WAR / EAR到容器的后期构建操作中,它对我来说也不起作用,我收到了错误:
 ERROR: Build step failed with exception
        org.codehaus.cargo.container.ContainerException: Failed to deploy to [http://hostname:9990/jmx-console/HtmlAdaptor]
          at org.codehaus.cargo.container.jboss.internal.JdkHttpURLConnection.connect(JdkHttpURLConnection.java:76)
          at org.codehaus.cargo.container.jboss.JBoss4xRemoteDeployer.invokeURL(JBoss4xRemoteDeployer.java:312)
          at org.codehaus.cargo.container.jboss.JBoss4xRemoteDeployer.invokeRemotely(JBoss4xRemoteDeployer.java:233)
          at org.codehaus.cargo.container.jboss.JBoss4xRemoteDeployer.redeploy(JBoss4xRemoteDeployer.java:194)
          at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:77)
          at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:147)
          at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:117)
          at hudson.FilePath.act(FilePath.java:997)
          at hudson.FilePath.act(FilePath.java:975)
          at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:114)
          at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeploy(PasswordProtectedAdapterCargo.java:93)
          at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:64)
          at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
          at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
          at hudson.model.Build$BuildExecution.post2(Build.java:186)
          at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
          at hudson.model.Run.execute(Run.java:1749)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:429)
        Caused by: java.io.FileNotFoundException: http://hostname:9990/jmx-console/HtmlAdaptor

? 提前谢谢

2 个答案:

答案 0 :(得分:0)

您需要配置WildFly管理界面以侦听由hostname表示的网络地址。否则,它默认只收听localhost

实现此目的的最简单方法是使用其他命令行选项启动WildFly。例如,如果hostname的IP地址为192.168.12.100,则:

 [wildfly-10.1.0.Final]$ bin/standalone.sh -bmanagement=192.168.12.100

答案 1 :(得分:0)

您尝试

  1. 将依赖项wildfly-cli-8.2.1.Final.jar复制到/ WEB-INF / lib。
  2. 将依赖项log4j-over-slf4j-1.7.7.jar复制到/ WEB-INF / lib。 (如果使用Jenkins 1.622或更高版本,则不需要。)

wildfly-deployer-plugin