17
Deploy apps in standalone with Maven By Anirban Sen Chowdhary

Deploy apps in standalone with maven

Embed Size (px)

Citation preview

Page 1: Deploy apps in standalone with maven

Deploy apps in standalone with Maven

By Anirban Sen Chowdhary

Page 2: Deploy apps in standalone with maven

There are various ways to deploy your Mule application. You can deploy your Mule application in Mule standalone in various ways…..One of the easiest way is to deploy your application in server is by using Maven

Page 3: Deploy apps in standalone with maven

So, How can we deploy our application using Maven ?

?

Page 4: Deploy apps in standalone with maven

Yes .. We can .. I will show you this trick .. How ??

Page 5: Deploy apps in standalone with maven

So, to build your application using Maven you need Maven installed in your system . You can get Maven from https://maven.apache.org/ So, if you have Maven already installed in your system, you need to create a Mule Project with Maven from your Anypoint Studio :-

You need to enable Maven while creating the project .. This will create a pom.xml for the project …

Page 6: Deploy apps in standalone with maven

You can see the pom.xml is created with the project . Now this is the file where you need to add all the Library dependencies for your project

Page 7: Deploy apps in standalone with maven

So let our flow be simple, We will display a payload in the browser after we hit a url http://localhost:8081/ in the browser:-

Page 8: Deploy apps in standalone with maven

The corresponding Mule flow will be as follows:-

So as you can see , we will be displaying “This is a test Data” payload in the browser if we hit url http://localhost:8081/ :-

Page 9: Deploy apps in standalone with maven

Now to deploy our application using Maven your need to first set your MULE_HOME with the path of your standalone server

Page 10: Deploy apps in standalone with maven

Now, you need to put the following in your pom.xml

This line of code will copy the deployable Mule zip file into apps folder of Mule Standalone server. But for that you must set MULE_HOME in your Environment variable

Page 11: Deploy apps in standalone with maven

So, let’s build our Mule application using Maven.If you have Mule plugins installed in your Anypoint Studio you can build the application, following way :

If you don’t have Maven plugins, you can build it from command prompt

Page 12: Deploy apps in standalone with maven

Now we can execute our pom.xml to build the application and deploy into our Mule Standalone and we will get the following result in our console :-

We can see that the application has build successfully

Page 13: Deploy apps in standalone with maven

If we go to our Mule Standalone apps folder we will see the application has been build into deployable zip file and copied into that location

The file is placed in apps folder of our Mule Standalone

Page 14: Deploy apps in standalone with maven

If we start our Mule Standalone server, we will find the application is deployed successfully !!

Page 15: Deploy apps in standalone with maven

To test the application if we hit the url http://localhost:8081/ in browser we will get the response in the browser :

You can see we have deployed a Mule application in Mule Standalone using Maven

Page 16: Deploy apps in standalone with maven

In my next slide I will bring some other techniques in Mule implementation .Hope you have enjoyed this simpler version. Keep sharing your knowledge and let our Mule community grow

Page 17: Deploy apps in standalone with maven

Thank You