Deploy to WildFly using curl (Tech Tip #10)

WildFly 8 provide multiple ways to deploy your web applications.

So far we’ve seen:

This tip will show how to use curl to deploy your applications to WildFly.

Deploying applications using curl is a two-step process.

Step 1: Upload your archive to WildFly using the following command:

This command:

  • Makes a POST request using form-encoded (“-F”) data with one field (“file”) defining the location of the WAR file
  • “target/javaee7-1.0-SNAPSHOT.war” is the location of the WAR file
  • “u1” is the administrative user with password “p1”
  • “localhost:9090” is the default management host and port for WildFly instance
  • WildFly management port uses digest authentication and that is defined using “–digest”
  • Prints the output as something like:
    {“outcome” : “success”, “result” : { “BYTES_VALUE” : “+Dg9u1ALXacrndNdLrT3DQSaqjw=” }}

Step 2: Deploy the archive

This command:

  • Sends a POST request (“-d”) with JSON payload
  • The value assigned to “result” name in the JSON response of previous command is used in this command
  • Content type of the payload is explicitly specified to be “application/json”
  • “add” command triggers the deployment of the archive
  • Application archive is enabled as well, as opposed to not by default
  • As earlier, “u1” is the administrative user with password “p1”
  • As earlier, “localhost:9090” is the default management host and port for WildFly instance
  • As earlier, WildFly management port uses digest authentication and that is defined using “–digest”

Now your application is available at http://localhost:8080/javaee7/EmployeeList or whatever the context root is!

That’s it!

Additional ways to deploy your applications will be discussed in subsequent blogs.

Be Sociable, Share!
  • Tweet

5 thoughts on “Deploy to WildFly using curl (Tech Tip #10)

  1. Pingback: Automated Wildfly deployments with Shell scripting - Java搧
  2. Pingback: netbeans8-wildfly8 | mauroprogram's Blog
  3. If you are unable to get help in Windows 10 so you may move to this http://gethelpwindows10.com portal where all information will be displayed you in the form of images so that you can easily seize information

  4. Maven plugin for consuming the Robot Framework. Goal of this plugin is to be talented to use Robot Framework https://www.aoneassignments.com/pay-someone-to-do-my-homework

Leave a Reply

Your email address will not be published. Required fields are marked *