Q: Jenkins Wildfly deploy I want to deploy a war file to wildfly from jenkins. I tried many methods but it doesn't work for me


*

*I used Deploy WAR/EAR to wildfly plugin but it is not working for me , i got the error : 



(FATAL: Unable to initialize command context. Build step 'Deploy
  WAR/EAR to WildFly' marked build as failure Finished: FAILURE),

I searched for that issue and the given answers didn't help me.


*

*In the post build actions I used Deploy WAR/EAR to a container , it doesn't work for me too, I got the error:



 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


?
Thank you in advance

A: You need to configure the WildFly management interface to listen on the network address represented by hostname. Otherwise it defaults to just listening on localhost.
The easiest way to accomplish this would be to start WildFly with an additional command line option. For example, if hostname has an IP address of 192.168.12.100, then:
 [wildfly-10.1.0.Final]$ bin/standalone.sh -bmanagement=192.168.12.100


A: you trying


*

*Copy dependency wildfly-cli-8.2.1.Final.jar to /WEB-INF/lib.

*Copy dependency log4j-over-slf4j-1.7.7.jar to /WEB-INF/lib. (Not required if using Jenkins version 1.622 or later.)


wildfly-deployer-plugin
