简体   繁体   中英

How to deploy Mule 4 application in Mule standalone server

Doing the deployment using jenkin-pipeline but for the deployment process we are getting error:

Failed to execute goal org.mule.tools.maven:mule-maven-plugin:3.2.7:deploy (default-deploy) on project helloworld: Execution default-deploy of goal org.mule.tools.maven:mule-maven-plugin:3.2.7:deploy failed: Mule Runtime is not running! Aborting.

I've added my pom.xml plugin.

     <plugins>
        <plugin>
            <groupId>org.mule.tools.maven</groupId>
            <artifactId>mule-maven-plugin</artifactId>
            <version>3.2.7</version>
            <extensions>true</extensions>
            <configuration>
                 <standaloneDeployment>
                  <muleHome>E:\IDFC\mule-enterprise-standalone-4.2.2</muleHome>
                  <muleVersion>4.2.2</muleVersion>
                 </standaloneDeployment>
            </configuration>
        </plugin>
    </plugins>

After this I have started E:\\IDFC\\mule-enterprise-standalone-4.2.2\\bin\\mule.bat and running the mvn clean package deploy -DmuleDeploy command from project location E:\\IDFC\\workspace\\helloworld and getting the error.

Where am I wrong and do I need to added anything more?

You need to start Mule as a (Windows) service.

Follow the steps documented here (Start Mule as a Windows Service):

https://docs.mulesoft.com/mule-runtime/4.2/starting-and-stopping-mule-esb

Then execute the Maven command again. This should work.

Easiest way to deploy app to the server is just copy jar file with the application to the app directory in the mule home.

Let's say your server is located at /home/mule/runtime/mule-enterprise-standalone-4.2.1 Export your application from Anypoint Studio as myApp.jar as Mule Delyable Archive and copy it to the /home/mule/runtime/mule-enterprise-standalone-4.2.1/apps folder. As soon as it is done (actually in 5 seconds interval) you will see myApp running on this server.

If you are on Windows - do the same. If you run your runtime inside Studio it tells you on the beginning where Mule home is. Like

MULE_HOME is set to C:\\work\\AnypointStudio7.4.2\\plugins\\org.mule.tooling.server.4.2.2.ee_7.3.5.202003161918\\mule

and that's the place which you may use to deploy your application (inside app folder). Yes, that's ringht. You can run anything inside your Studio runtime and when it is running you can add additional apps to this already running runtime.

Just keep in mind that usually Stduio creates this runtime from scratch and clears previous apps. So you have to copy these extra jars every single time wen you restart your restart your Studio project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM