Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ModuleBinaries |
|
| 1.0625;1.062 |
1 | /* | |
2 | * $Id$ | |
3 | */ | |
4 | ||
5 | package org.apache.maven.plugins.assembly.model; | |
6 | ||
7 | /** | |
8 | * | |
9 | * Contains configuration options for including the binary | |
10 | * files of a | |
11 | * project module in an assembly. | |
12 | * | |
13 | * | |
14 | * @version $Revision$ $Date$ | |
15 | */ | |
16 | 0 | public class ModuleBinaries extends SetBase |
17 | implements java.io.Serializable | |
18 | { | |
19 | ||
20 | ||
21 | //--------------------------/ | |
22 | //- Class/Member Variables -/ | |
23 | //--------------------------/ | |
24 | ||
25 | /** | |
26 | * Field attachmentClassifier | |
27 | */ | |
28 | private String attachmentClassifier; | |
29 | ||
30 | /** | |
31 | * Field includeDependencies | |
32 | */ | |
33 | 0 | private boolean includeDependencies = true; |
34 | ||
35 | /** | |
36 | * Field dependencySets | |
37 | */ | |
38 | private java.util.List dependencySets; | |
39 | ||
40 | /** | |
41 | * Field unpack | |
42 | */ | |
43 | 0 | private boolean unpack = true; |
44 | ||
45 | /** | |
46 | * Field unpackOptions | |
47 | */ | |
48 | private UnpackOptions unpackOptions; | |
49 | ||
50 | /** | |
51 | * Field outputFileNameMapping | |
52 | */ | |
53 | 0 | private String outputFileNameMapping = "${artifactId}-${version}.${extension}"; |
54 | ||
55 | ||
56 | //-----------/ | |
57 | //- Methods -/ | |
58 | //-----------/ | |
59 | ||
60 | /** | |
61 | * Method addDependencySet | |
62 | * | |
63 | * @param dependencySet | |
64 | */ | |
65 | public void addDependencySet(DependencySet dependencySet) | |
66 | { | |
67 | 0 | getDependencySets().add( dependencySet ); |
68 | 0 | } //-- void addDependencySet(DependencySet) |
69 | ||
70 | /** | |
71 | * Get | |
72 | * When specified, the attachmentClassifier will | |
73 | * cause the assembler to look at artifacts | |
74 | * attached to the module instead of the main project | |
75 | * artifact. If it can find an attached | |
76 | * artifact matching the specified classifier, it | |
77 | * will use it; otherwise, it will throw an | |
78 | * exception. (Since 2.2) | |
79 | * | |
80 | */ | |
81 | public String getAttachmentClassifier() | |
82 | { | |
83 | 0 | return this.attachmentClassifier; |
84 | } //-- String getAttachmentClassifier() | |
85 | ||
86 | /** | |
87 | * Method getDependencySets | |
88 | */ | |
89 | public java.util.List getDependencySets() | |
90 | { | |
91 | 0 | if ( this.dependencySets == null ) |
92 | { | |
93 | 0 | this.dependencySets = new java.util.ArrayList(); |
94 | } | |
95 | ||
96 | 0 | return this.dependencySets; |
97 | } //-- java.util.List getDependencySets() | |
98 | ||
99 | /** | |
100 | * Get | |
101 | * Sets the mapping pattern for all dependencies | |
102 | * included | |
103 | * in this assembly. | |
104 | * Default is | |
105 | * ${artifactId}-${version}.${extension}. | |
106 | * | |
107 | */ | |
108 | public String getOutputFileNameMapping() | |
109 | { | |
110 | 0 | return this.outputFileNameMapping; |
111 | } //-- String getOutputFileNameMapping() | |
112 | ||
113 | /** | |
114 | * Get | |
115 | * Allows the specification of includes and excludes, | |
116 | * along with filtering options, for items | |
117 | * unpacked from a module artifact. (Since 2.2) | |
118 | * | |
119 | */ | |
120 | public UnpackOptions getUnpackOptions() | |
121 | { | |
122 | 0 | return this.unpackOptions; |
123 | } //-- UnpackOptions getUnpackOptions() | |
124 | ||
125 | /** | |
126 | * Get | |
127 | * If set to true, the plugin will include the direct | |
128 | * and transitive dependencies of | |
129 | * of the project modules included here. Otherwise, | |
130 | * it will only include the module | |
131 | * packages only. Default value is true. | |
132 | * | |
133 | */ | |
134 | public boolean isIncludeDependencies() | |
135 | { | |
136 | 0 | return this.includeDependencies; |
137 | } //-- boolean isIncludeDependencies() | |
138 | ||
139 | /** | |
140 | * Get | |
141 | * If set to true, this property will unpack all | |
142 | * module packages | |
143 | * into the specified output directory. When set to | |
144 | * false | |
145 | * module packages will be included as archives | |
146 | * (jars). | |
147 | * Default value is true. | |
148 | * | |
149 | */ | |
150 | public boolean isUnpack() | |
151 | { | |
152 | 0 | return this.unpack; |
153 | } //-- boolean isUnpack() | |
154 | ||
155 | /** | |
156 | * Method removeDependencySet | |
157 | * | |
158 | * @param dependencySet | |
159 | */ | |
160 | public void removeDependencySet(DependencySet dependencySet) | |
161 | { | |
162 | 0 | getDependencySets().remove( dependencySet ); |
163 | 0 | } //-- void removeDependencySet(DependencySet) |
164 | ||
165 | /** | |
166 | * Set | |
167 | * When specified, the attachmentClassifier will | |
168 | * cause the assembler to look at artifacts | |
169 | * attached to the module instead of the main project | |
170 | * artifact. If it can find an attached | |
171 | * artifact matching the specified classifier, it | |
172 | * will use it; otherwise, it will throw an | |
173 | * exception. (Since 2.2) | |
174 | * | |
175 | * | |
176 | * @param attachmentClassifier | |
177 | */ | |
178 | public void setAttachmentClassifier(String attachmentClassifier) | |
179 | { | |
180 | 0 | this.attachmentClassifier = attachmentClassifier; |
181 | 0 | } //-- void setAttachmentClassifier(String) |
182 | ||
183 | /** | |
184 | * Set | |
185 | * | |
186 | * Specifies which dependencies of the module to | |
187 | * include in the assembly. A | |
188 | * dependencySet is specified by providing one or | |
189 | * more of | |
190 | * <dependencySet> subelements. (Since 2.2) | |
191 | * | |
192 | * | |
193 | * | |
194 | * @param dependencySets | |
195 | */ | |
196 | public void setDependencySets(java.util.List dependencySets) | |
197 | { | |
198 | 0 | this.dependencySets = dependencySets; |
199 | 0 | } //-- void setDependencySets(java.util.List) |
200 | ||
201 | /** | |
202 | * Set | |
203 | * If set to true, the plugin will include the direct | |
204 | * and transitive dependencies of | |
205 | * of the project modules included here. Otherwise, | |
206 | * it will only include the module | |
207 | * packages only. Default value is true. | |
208 | * | |
209 | * | |
210 | * @param includeDependencies | |
211 | */ | |
212 | public void setIncludeDependencies(boolean includeDependencies) | |
213 | { | |
214 | 0 | this.includeDependencies = includeDependencies; |
215 | 0 | } //-- void setIncludeDependencies(boolean) |
216 | ||
217 | /** | |
218 | * Set | |
219 | * Sets the mapping pattern for all dependencies | |
220 | * included | |
221 | * in this assembly. | |
222 | * Default is | |
223 | * ${artifactId}-${version}.${extension}. | |
224 | * | |
225 | * | |
226 | * @param outputFileNameMapping | |
227 | */ | |
228 | public void setOutputFileNameMapping(String outputFileNameMapping) | |
229 | { | |
230 | 0 | this.outputFileNameMapping = outputFileNameMapping; |
231 | 0 | } //-- void setOutputFileNameMapping(String) |
232 | ||
233 | /** | |
234 | * Set | |
235 | * If set to true, this property will unpack all | |
236 | * module packages | |
237 | * into the specified output directory. When set to | |
238 | * false | |
239 | * module packages will be included as archives | |
240 | * (jars). | |
241 | * Default value is true. | |
242 | * | |
243 | * | |
244 | * @param unpack | |
245 | */ | |
246 | public void setUnpack(boolean unpack) | |
247 | { | |
248 | 0 | this.unpack = unpack; |
249 | 0 | } //-- void setUnpack(boolean) |
250 | ||
251 | /** | |
252 | * Set | |
253 | * Allows the specification of includes and excludes, | |
254 | * along with filtering options, for items | |
255 | * unpacked from a module artifact. (Since 2.2) | |
256 | * | |
257 | * | |
258 | * @param unpackOptions | |
259 | */ | |
260 | public void setUnpackOptions(UnpackOptions unpackOptions) | |
261 | { | |
262 | 0 | this.unpackOptions = unpackOptions; |
263 | 0 | } //-- void setUnpackOptions(UnpackOptions) |
264 | ||
265 | ||
266 | 0 | private String modelEncoding = "UTF-8"; |
267 | ||
268 | public void setModelEncoding( String modelEncoding ) | |
269 | { | |
270 | 0 | this.modelEncoding = modelEncoding; |
271 | 0 | } |
272 | ||
273 | public String getModelEncoding() | |
274 | { | |
275 | 0 | return modelEncoding; |
276 | }} |