1 package org.andromda.maven.plugin.andromdapp;
2
3 import java.io.File;
4
5 import org.apache.maven.plugin.AbstractMojo;
6 import org.apache.maven.plugin.MojoExecutionException;
7 import org.apache.maven.project.MavenProject;
8 import org.apache.commons.lang.StringUtils;
9
10
11
12
13
14
15
16 public abstract class AppManagementMojo
17 extends AbstractMojo
18 {
19
20
21
22
23
24
25 protected File deployLocation;
26
27
28
29
30
31
32 protected MavenProject project;
33
34
35
36
37
38
39
40
41 protected String getPackaging() throws MojoExecutionException
42 {
43 final String packaging = this.project.getPackaging();
44 if (StringUtils.isBlank(packaging))
45 {
46 throw new MojoExecutionException(
47 "This project must have the packaging defined, when attempting to deploy exploded");
48 }
49 return packaging;
50 }
51
52
53
54
55
56
57
58 protected File getDeployFile() throws MojoExecutionException
59 {
60 return new File(this.deployLocation, this.project.getBuild().getFinalName() + '.' + this.getPackaging());
61 }
62 }