This documentation is for WSO2 Developer Studio version 3.7.0. View documentation for the latest release.
Deploying a CAR File with the Maven Plug-In - Developer Studio 3.7.0 - WSO2 Documentation
||
Skip to end of metadata
Go to start of metadata

This page walks you through how to deploy a CAR file containing ESB artifacts using the Maven plug-in. It includes the following sections:

This sample refers to the following products and their versions:

WSO2 ESB - 4.7.0 and 4.8.1

WSO2 Developer Studio - 3.2.0

Create an ESB Config Project

Follow the steps below to create an ESB config project:

  1. Open the Eclipse instance running WSO2 Developer Studio. 
  2. Click Developer Studio > Open Dashboard to open the Developer Studio Dashboard.
  3. Click ESB Config Project under the Enterprise Service Bus category.
  4. Enter the project name as ESBDeploySample and click Finish.

Create a Proxy Service

  1. Click the ESBDeploySample project in the Project Explorer.

  2. Click Developer Studio > Open Dashboard. Click Proxy Service.

  3. Enter the proxy service name as ProxySample.

Now you have a simple proxy service that you can deploy to WSO2 ESB.

Create a Composite Application Project

  1. Open the Developer Studio Dashboard and click Composite Application Project under the Distribution category.

  2. Enter the project name as CappSample and click Finish.

  3. Open the pom.xml file of the CappSample project and select the check box for the ESBDeploySample project to add it to the C-App.

  4. In the Source view of the pom.xml file, add following code snippet under the <plugins> element. (Make sure you add this plugin after the existing entry for maven-eclipse-plugin):

    <plugin>
       <groupId>org.wso2.maven</groupId>
       <artifactId>maven-car-deploy-plugin</artifactId>
       <version>1.0.0</version>
       <extensions>true</extensions>
       <configuration>
        <carbonServers>
         <CarbonServer>
    <trustStorePath>/home/sohani/Desktop/ESB/wso2esb-4.7.0/repository/resources/security/wso2carbon.jks</trustStorePath>
          <trustStorePassword>wso2carbon</trustStorePassword>
          <trustStoreType>JKS</trustStoreType>
          <serverUrl>https://localhost:9443</serverUrl>
          <userName>admin</userName>
          <password>admin</password>
          <operation>deploy</operation>
         </CarbonServer>
        </carbonServers>
       </configuration>
    </plugin>
    Give the actual location of the wso2carbon.jks file at the <trustStorePath> element ($ESB_HOME/repository/resources/security/wso2carbon.jks).
  5. Save your changes.

Deploy CAR file to the WSO2 ESB server

  1. Start the WSO2 ESB server in your machine.

  2. Build the ESBDeploySample project using the mvn clean install command.

  3. Build the CappSample project using the commands listed below.

In order to enable the deployment of a CAR file to a Carbon Server, you can do one of the following,

  • Add <maven.car.deploy.skip>false</maven.car.deploy.skip> to the properties section of the C-App project's pom.xml file
  • Provide -Dmaven.car.deploy.skip=false with the mvn clean deploy command.  E.g: mvn clean deploy -Dmaven.car.deploy.skip=false

After building the project, you can see that the ProxySample proxy service has been deployed to the sever as shown in the figure below:

In order to disable the deployment of a CAR file to a Carbon Server, you can do one of the following:

  • Add <maven.car.deploy.skip>true</maven.car.deploy.skip> to the properties section of the C-App project's pom.xml file
  • Provide -Dmaven.car.deploy.skip=true with the mvn clean deploy command.  E.g: mvn clean deploy -Dmaven.car.deploy.skip=true

In order to undeploy the deployment of a CAR file to a Carbon Server, 

Provide -Doperation=undeploy -Dmaven.deploy.skip=true -Dmaven.car.deploy.skip=false with the mvn clean deploy command. E.g: mvn clean deploy -Doperation=undeploy -Dmaven.deploy.skip=true -Dmaven.car.deploy.skip=false

  • No labels