In this post I will try to make life with AndroMDA custom cartridge easier by guiding you step by step to Build, Run, and Integrate the sample custom cartridge (deployment-cartridge) into your andromda application.
most of the problems that any newbie may face when he decide to develop his own custom cartridge are:
Wow the "10 steps to write a cartridge" posted in the http://andromda.orglooks great and I guess I will get better understanding if I see this in action and tried it by my hand but
- How to do that?
- How to apply this steps?
- Where the empty model that I will start modeling my own custom cartridge in?
- A lot of questions will rise in your mind, and even if you got some idea about the direction you should pass throw, you will find some other question arising such as if the sample deployment-cartridge works how to integrate it into my andromdaapplication (I wanna add it to the selected cartridges -Java, Spring, Hibernate-) but don't know how.
the answer to all of this question is so simple off course it is not before doing it ;)
So lets start the step by step guide to have the sample deployment-cartridge running inside your andromda project:
- Download andromda-src-3.2.zip or andromda-src-3.3.zipfrom source forge
- AndroMDA 3.3 http://sourceforge.net/projects/andromda/files/1.%20andromda%20V3.x/3.3/
- AndroMDA 3.2 http://sourceforge.net/projects/andromda/files/1.%20andromda%20V3.x/3.2/
- Extract the downloaded andromda-src-3.2.zip to andromda-src-3.2
- Navigate to the following path andromda-src-3.3/cartridges/ and issue mvn to get most of the needed cartridges installed to you repository.
- Navigate to the following path andromda-src-3.2\samples\deployment-cartridge
- then execute mvnin command line this will build the cartridge and install it to your maven repository, and will trigger the deployment-cartridge against the DeploymentCartridgeTestModel.xml.zip located under the following location \andromda-src-3.2\samples\deployment-cartridge\src\test\uml and will generate the two files (build.xml, DeploymentReport.xml) under the following location \andromda-src-3.2\samples\deployment-cartridge\target\cartridge-test\actual
- till now we have built the deployment-cartridgeand tested it and see the result of this cartridge.
- Now we want to integrate this deployment-cartridge into our own andromda projects and to do that do the following two steps:
- Register the deployment-cartridgenamespace into your project by adding the following lines to andromda.xml which is located under \mda\src\main\config
<namespace name="deployment"> <properties> <property name="deploymentreport">${common.generated.dir}</property> <property name="antprojects">${common.generated.dir}</property> </properties> </namespace> - Then add the deployment-cartridge as dependency inside the \mda\pom.xml as follows:
<dependency> <groupId>org.andromda.cartridges</groupId> <artifactId>andromda-deployment-cartridge</artifactId> </dependency>
- and add it also as dependecny in the root pom.xml as follows:
<dependency> <groupId>org.andromda.cartridges</groupId> <artifactId>andromda-deployment-cartridge</artifactId> <version>3.2</version> <scope>runtime</scope> </dependency> - you might face the following problem how to model the <<manifest>> , and <<wraps>> to the model. you can do it simply by creating new element>>stereotype and select Dependency to be the Base Class.
- then issue mvn on your project and you will get the two files (build.xml, DeploymentReport.xml) under the following location$Application_ID\common\target\src
Now you can read the "10 steps to write a cartridge" and try changing adding new things to the deployment-cartridge and build it and try it with your own project.
References:

Recent comments
2 weeks 16 hours ago
15 weeks 5 days ago
16 weeks 11 hours ago
16 weeks 11 hours ago
27 weeks 3 days ago
31 weeks 4 days ago
32 weeks 5 days ago
1 year 2 days ago
1 year 2 days ago
1 year 4 weeks ago