1 | |
package org.apache.tomcat.maven.common.config; |
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
import org.apache.commons.lang.StringUtils; |
23 | |
import org.apache.maven.artifact.Artifact; |
24 | |
|
25 | |
import java.io.File; |
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
public class AbstractWebapp |
31 | |
{ |
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
private String groupId; |
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
private String artifactId; |
42 | |
|
43 | |
|
44 | |
|
45 | |
|
46 | 0 | private String version = null; |
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | 0 | private String type = "war"; |
52 | |
|
53 | |
|
54 | |
|
55 | |
|
56 | |
private String classifier; |
57 | |
|
58 | |
|
59 | |
|
60 | |
|
61 | |
private String contextPath; |
62 | |
|
63 | |
private Artifact artifact; |
64 | |
|
65 | |
private File contextFile; |
66 | |
|
67 | 0 | private boolean asWebapp = false; |
68 | |
|
69 | |
public AbstractWebapp() |
70 | |
{ |
71 | 0 | super(); |
72 | 0 | } |
73 | |
|
74 | |
public AbstractWebapp( Artifact artifact ) |
75 | 0 | { |
76 | 0 | this.setArtifact( artifact ); |
77 | 0 | this.setGroupId( artifact.getGroupId() ); |
78 | 0 | this.setArtifactId( artifact.getArtifactId() ); |
79 | 0 | this.setVersion( artifact.getVersion() ); |
80 | 0 | this.setClassifier( artifact.getClassifier() ); |
81 | 0 | this.setType( artifact.getType() ); |
82 | 0 | } |
83 | |
|
84 | |
public String getGroupId() |
85 | |
{ |
86 | 0 | return groupId; |
87 | |
} |
88 | |
|
89 | |
public void setGroupId( String groupId ) |
90 | |
{ |
91 | 0 | this.groupId = groupId; |
92 | 0 | } |
93 | |
|
94 | |
public String getArtifactId() |
95 | |
{ |
96 | 0 | return artifactId; |
97 | |
} |
98 | |
|
99 | |
public void setArtifactId( String artifactId ) |
100 | |
{ |
101 | 0 | this.artifactId = artifactId; |
102 | 0 | } |
103 | |
|
104 | |
public String getVersion() |
105 | |
{ |
106 | 0 | return version; |
107 | |
} |
108 | |
|
109 | |
public void setVersion( String version ) |
110 | |
{ |
111 | 0 | this.version = version; |
112 | 0 | } |
113 | |
|
114 | |
public String getType() |
115 | |
{ |
116 | 0 | return type; |
117 | |
} |
118 | |
|
119 | |
public void setType( String type ) |
120 | |
{ |
121 | 0 | this.type = type; |
122 | 0 | } |
123 | |
|
124 | |
public String getClassifier() |
125 | |
{ |
126 | 0 | return classifier; |
127 | |
} |
128 | |
|
129 | |
public void setClassifier( String classifier ) |
130 | |
{ |
131 | 0 | this.classifier = classifier; |
132 | 0 | } |
133 | |
|
134 | |
public String getContextPath() |
135 | |
{ |
136 | 0 | if ( StringUtils.isEmpty( contextPath ) ) |
137 | |
{ |
138 | 0 | return this.artifactId; |
139 | |
} |
140 | 0 | return contextPath; |
141 | |
} |
142 | |
|
143 | |
public void setContextPath( String contextPath ) |
144 | |
{ |
145 | 0 | this.contextPath = contextPath; |
146 | 0 | } |
147 | |
|
148 | |
public Artifact getArtifact() |
149 | |
{ |
150 | 0 | return artifact; |
151 | |
} |
152 | |
|
153 | |
public void setArtifact( Artifact artifact ) |
154 | |
{ |
155 | 0 | this.artifact = artifact; |
156 | 0 | } |
157 | |
|
158 | |
public void setContextFile( File contextFile ) |
159 | |
{ |
160 | 0 | this.contextFile = contextFile; |
161 | 0 | } |
162 | |
|
163 | |
public File getContextFile() |
164 | |
{ |
165 | 0 | return contextFile; |
166 | |
} |
167 | |
|
168 | |
public boolean isAsWebapp() |
169 | |
{ |
170 | 0 | return asWebapp; |
171 | |
} |
172 | |
|
173 | |
public void setAsWebapp( boolean asWebapp ) |
174 | |
{ |
175 | 0 | this.asWebapp = asWebapp; |
176 | 0 | } |
177 | |
} |