Testing and Deploying
Deploy C-App to a running server inside EclipseBefore deploy the created CApp project, you have to choose the artifacts you need to deploy. For that, double click on the root-artifact.xml and select artifacts you need to deploy and save the changes.
Go to Servers view, right click and select New -> Server .
Select WSO2 Carbon 3.0 under the catogery of WSO2.
If you have not added WSO2 Server instances before, you will need to specify location of the downloaded WSO2 Server instance.
Now you will see WSO2 Carbon 3.0 is added for Server Runtime Environments. Then 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.
Add the CApp project and click Finish.
Now you will see newly added server is listed in the Servers view. Right click on the WSO2 Carbon 3.0 at localhost and select Start from the menu.
You will see messages are pop up in the console and when the deployment is done, it will ask to restart the server.
When the server is restarted, you can check whether your CApp project is deployed.
Redeploy an already deployed C-App to a running server inside Eclipse
After you have deployed your C-App to a running server inside Eclipse, you may want to change the content of your C-App. In that case you do not need to remove the deployed C-App from the server and deploy again to the server. Instead you can redeploy an already deployed C-App.
Deploy the C-App project according to the instructions given above and then do the necessary changes to your C-App project.
Open the Servers view in Eclipse using Window => Show View => Servers.
Click on the expandable icon of the Server you are running inside Eclipse. (This expandble icons available only if you have deployed a project in that server)
Right click on the project and Select Redeploy option from the popup menu.
Then you will see that your Eclipse console is updated and you can notice that your C-App project is deployed again.
Create Carbon Application Archive (Car) file
There are two ways you can create a .car file. One way is to right click on the CApp project and select Carbon Application Archive [CAR] from the Export menu.
The other way is to select the option from the root-artifact.xml. Open the root-artifact.xml and there is a button to create the Carbon Application Archive [CAR] at the right most top corner.
Then select the artifacts you want to include to the Carbon Application Archive [CAR] and click finish.
Specify the location to save the Carbon Application Archive [CAR] file.
Now you have successfully created a Carbon Application Archive [CAR] file which is ready to be deployed.