01: package org.andromda.maven.plugin.andromdapp;
02:
03: import org.andromda.andromdapp.AndroMDApp;
04: import org.apache.maven.plugin.MojoExecutionException;
05:
06: /**
07: * Removes the an AndroMDApp generated application structure.
08: *
09: * @author Chad Brandon
10: * @goal clean-structure
11: * @requiresProject false
12: */
13: public class AndroMDAppCleanMojo extends AbstractAndroMDAppMojo {
14: /**
15: * @see org.apache.maven.plugin.Mojo#execute()
16: */
17: public void execute() throws MojoExecutionException {
18: try {
19: final AndroMDApp andromdapp = new AndroMDApp();
20: final String configuration = this
21: .getConfigurationContents();
22: if (configuration != null) {
23: andromdapp.addConfiguration(this
24: .getConfigurationContents());
25: }
26: andromdapp.clean();
27: } catch (final Throwable throwable) {
28: if (throwable instanceof MojoExecutionException) {
29: throw (MojoExecutionException) throwable;
30: }
31: throw new MojoExecutionException(
32: "An error occurred while attempting to generate an application",
33: throwable);
34: }
35: }
36: }
|