deploy apps in standalone with maven
TRANSCRIPT
![Page 1: Deploy apps in standalone with maven](https://reader035.vdocument.in/reader035/viewer/2022062406/55c4af7ebb61eb84118b4659/html5/thumbnails/1.jpg)
Deploy apps in standalone with Maven
By Anirban Sen Chowdhary
![Page 2: Deploy apps in standalone with maven](https://reader035.vdocument.in/reader035/viewer/2022062406/55c4af7ebb61eb84118b4659/html5/thumbnails/2.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062406/55c4af7ebb61eb84118b4659/html5/thumbnails/3.jpg)
So, How can we deploy our application using Maven ?
?
![Page 4: Deploy apps in standalone with maven](https://reader035.vdocument.in/reader035/viewer/2022062406/55c4af7ebb61eb84118b4659/html5/thumbnails/4.jpg)
Yes .. We can .. I will show you this trick .. How ??
![Page 5: Deploy apps in standalone with maven](https://reader035.vdocument.in/reader035/viewer/2022062406/55c4af7ebb61eb84118b4659/html5/thumbnails/5.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062406/55c4af7ebb61eb84118b4659/html5/thumbnails/6.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062406/55c4af7ebb61eb84118b4659/html5/thumbnails/7.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062406/55c4af7ebb61eb84118b4659/html5/thumbnails/8.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062406/55c4af7ebb61eb84118b4659/html5/thumbnails/9.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062406/55c4af7ebb61eb84118b4659/html5/thumbnails/10.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062406/55c4af7ebb61eb84118b4659/html5/thumbnails/11.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062406/55c4af7ebb61eb84118b4659/html5/thumbnails/12.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062406/55c4af7ebb61eb84118b4659/html5/thumbnails/13.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062406/55c4af7ebb61eb84118b4659/html5/thumbnails/14.jpg)
If we start our Mule Standalone server, we will find the application is deployed successfully !!
![Page 15: Deploy apps in standalone with maven](https://reader035.vdocument.in/reader035/viewer/2022062406/55c4af7ebb61eb84118b4659/html5/thumbnails/15.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062406/55c4af7ebb61eb84118b4659/html5/thumbnails/16.jpg)
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](https://reader035.vdocument.in/reader035/viewer/2022062406/55c4af7ebb61eb84118b4659/html5/thumbnails/17.jpg)
Thank You