Saturday, July 28, 2007

AndroMDA: Generating create/drop schema script with Maven 2

First of all I would recommend anyone who is using the anroMDA for first time to read
${application_root}/readme.txt file carefully. This helps understanding the generated schema.

If you read readme.txt, you will notice two tasks

  • mvn -f core/pom.xml andromdapp:schema -Dtasks=create --> generates the DDL create code and subsequently tells the database to create the schema for the entities

  • mvn -f core/pom.xml andromdapp:schema -Dtasks=drop --> generates the DDL drop code and subsequently tells the database to drop the schema for the entities

  • mvn -f core/pom.xml andromdapp:schema -Dtasks=drop,create
But wait, these target don't seem to work for me if i use maven-2 (mvn) with AndroMDA 3.2.
add following to the plugin configuration in core/pom.xml
<executescripts>false</executescripts>
<tasks>create</tasks>
<tasks>drop</tasks>
and now when you run the above targets, the create and drop DDLs are generated in the path specified by createOutputPath and dropOutputPath property.

The default location for generated scripts is ${application_root}/app/target/

No comments: