...
To deploy the CAR file for the C-App to a Carbon server, start the server, log in to the management console for that product, go to Application -> Add, and browse for the CAR file that you have created.
Once you click Upload, you will be asked to Refresh the browser. Once you refresh, you will see that the CAR file has been deployed.
...
Before you deploy the created C-App project, you have to choose the artifacts you need to deploy. For that, double click on the pom.xml and select artifacts you need to deploy and save the changes.
Go to Servers view, right click and select New -> Server.
...
Now you will see your version of the server (for example WSO2 Carbon 4.2 based server) added to the Server Runtime Environments. Click OK.
You can change ports if you want. If the default ports are not used by any other application, you can keep them as they are. After setting the ports click Next.
...
The WSO2 CAR Deploy plug-in for Maven allows you to generate the CAR file for a C-App and then deploy it (or undeploy it) on multiple local and remote Carbon servers, including StratosLivePaas. To use this plug-in, you add it to the pom.xml file for your C-App and then use the mvn clean deploy command to generate and deploy the CAR. See the Deploying a CAR File with the Maven Plug-In sample for a walk-though of how to deploy a CAR file containing ESB artifacts.
Adding the plug-in to the POM file
Code Block | ||
---|---|---|
| ||
<plugin>
<groupId>org.wso2.maven</groupId>
<artifactId>maven-car-deploy-plugin</artifactId>
<version>1.0.0</version>
<extensions>true</extensions>
<configuration>
<carbonServers>
<CarbonServer>
<trustStorePath>${basedir}/src/main/resources/security/wso2carbon.jks </trustStorePath>
<trustStorePassword>wso2carbon</trustStorePassword>
<trustStoreType>JKS</trustStoreType>
<serverUrl>https://${host}:${port}</serverUrl>
<userName>admin</userName>
<password>${password}</password>
<operation>deploy|undeploy</operation>
</CarbonServer>
<CarbonServer>
<trustStorePath>${basedir}/src/main/resources/security/wso2carbon.jks
</trustStorePath>
<trustStorePassword>wso2carbon</trustStorePassword>
<trustStoreType>JKS</trustStoreType>
<serverUrl>https://localhost:9445</serverUrl>
<userName>admin</userName>
<password>admin</password>
<operation>deploy|undeploy</operation>
</CarbonServer>
.
.
.
</carbonServers>
</configuration>
</plugin> |
- Under the C-App you want to deploy, double-click the
pom.xml
file file to open it in the editor. - Click the the Source tab tab and navigate to the the
maven-car-deploy-plugin
under under<build>
-> ><plugins>
. - Modify the the
maven-car-deploy-plugin
properties properties as follows:- Under Under
<carbonServers>
, create one one<CarbonServer>
for for each Carbon server where you want to deploy the CAR file. - Specify the following properties for each Carbon server:
- If you are using a custom certificate with your Carbon server, import the public key of the custom certificate to your trust store, and then set
- the
<trustStorePath>
,<trustStorePassword>
,
- the
- and
<trustStoreType>
- and
- properties to the location, password, and type of your trust store.
- Set
- the
<serverUrl>
,<userName>
,
- the
- and
<password>
- and
- properties to the URL (such as
https://localhost:9443
), user name, and password for the Carbon server. - In
- properties to the URL (such as
- the
<operation>
- the
- element, specify whether to deploy or undeploy the CAR file for this Carbon server.
- element, specify whether to deploy or undeploy the CAR file for this Carbon server.
<properties>
section at the end of the POM file, do the following:To deploy:
<operation>deploy</operation>
To undeploy:
<operation>undeploy</operation>
Add the following line to the properties to ensure that the CAR file will be deployed:
Code Block language xml <maven.car.deploy.skip>false</maven.car.deploy.skip>
If you want to deploy the CAR file to a remote Maven repository in addition to the Carbon servers, add the following line to the properties:
Code Block language xml <maven.deploy.skip>false</maven.deploy.
Note:skip>
Info You will be able to override both of these settings when you run the Maven command.
- Under Under
- Save the file. You are now ready to generate and deploy the CAR file for this C-App.
Generating and deploying the CAR file
...
Then create a Composite Application Project to group it.
Now add a WSO2 Application Server instance to your Eclipse workspace. Steps to add a Carbon Server is described in the Deploy a C-App to a running Server inside Eclipse section. After adding the server, start the server in the debug mode.
...
Now go back to your web console and invoke the service. Once you invoke the service, it will ask you are asked whether to change in to into the Debug Perspective in Eclipse.
Click Yes. If your Eclipse instance could not find the relavent source for the class, it will show a blank page as below.
...
Click Add and select the Java Project.
Select the GreetingService project from the list and click OK.
Now you will see the source being attached and you will see the debug point being hit.
...