Tuesday, June 29, 2010

Speeding up Andromda

Andromda is a bit of a hog when you are trying to do a maven compile.  We have a pretty complex model, and we use Andromda to generate all of our backend classes.  On my machine our 'normal' maven build takes approximately 2 min and 45 secs to do the andromda generate, and compile the classes.  Acceptable after a model change, since I model relatively rarely.  Too much time when you are doing normal coding activities.

Here are a few tips:

You can do a:

Skip unit tests:
mvn -Dmaven.test.skip to skip unit tests.

Do an offline build:
mvn -o this will do an 'offline' build, saving the check of all of the SNAPSHOT dependencies.  Andromda has a lot of them!

Skip Andromda model validation:
mvn -Dvalidation=false  this skips the validation of the model, and will go right into the compile.  This saves about 45 seconds on my machine.


Use andromda server:
There is a mvn mda\pom.xml andromda:start-server
This loads a memory resident verion of andromda and loads the xml into memory.  This will monitor the model as well and auto-reload it into memory apon changes.  In a separate command window you can then issue your normal andromda commands, and it will trigger this 'server window' to perform the andromda portion of your build.  Everything seemed to work with this, but when I did my build I got some compile errors that I did not have doing the non server build.... maybe have a path issue or something... going to have to look into this further.  This method on my machine compiled in 30 seconds, saving 2mins 15 sec per build... so this will warrent some further investigation.  If anyone has any insight into the andromda server let me know.

Build only the modules you are working on:

You are supposed to be able to run
mvn -f core/pom.xml to compile just the core package, but this totally blows up for me due to dependencies in the common package etc.  Did not have time to frig with this ... again, any insight on getting this going, please let me know.

No comments:

Post a Comment