Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ModuleSet |
|
| 1.125;1.125 |
1 | /* | |
2 | * $Id$ | |
3 | */ | |
4 | ||
5 | package org.apache.maven.plugins.assembly.model; | |
6 | ||
7 | /** | |
8 | * | |
9 | * | |
10 | * A moduleSet represent one or more project <module> | |
11 | * present inside | |
12 | * a project's pom.xml. This allows you to include sources | |
13 | * or binaries | |
14 | * belonging to a project's <modules>. | |
15 | * | |
16 | * <br/><b>NOTE:</b> When using <moduleSets> from the | |
17 | * command-line, it | |
18 | * is required to pass first the package phase by doing: | |
19 | * "mvn package | |
20 | * assembly:assembly". This bug/issue is scheduled to be | |
21 | * addressed by Maven 2.1. | |
22 | * | |
23 | * | |
24 | * | |
25 | * @version $Revision$ $Date$ | |
26 | */ | |
27 | 0 | public class ModuleSet implements java.io.Serializable { |
28 | ||
29 | ||
30 | //--------------------------/ | |
31 | //- Class/Member Variables -/ | |
32 | //--------------------------/ | |
33 | ||
34 | /** | |
35 | * Field includeSubModules | |
36 | */ | |
37 | 0 | private boolean includeSubModules = true; |
38 | ||
39 | /** | |
40 | * Field includes | |
41 | */ | |
42 | private java.util.List includes; | |
43 | ||
44 | /** | |
45 | * Field excludes | |
46 | */ | |
47 | private java.util.List excludes; | |
48 | ||
49 | /** | |
50 | * Field sources | |
51 | */ | |
52 | private ModuleSources sources; | |
53 | ||
54 | /** | |
55 | * Field binaries | |
56 | */ | |
57 | private ModuleBinaries binaries; | |
58 | ||
59 | ||
60 | //-----------/ | |
61 | //- Methods -/ | |
62 | //-----------/ | |
63 | ||
64 | /** | |
65 | * Method addExclude | |
66 | * | |
67 | * @param string | |
68 | */ | |
69 | public void addExclude(String string) | |
70 | { | |
71 | 0 | getExcludes().add( string ); |
72 | 0 | } //-- void addExclude(String) |
73 | ||
74 | /** | |
75 | * Method addInclude | |
76 | * | |
77 | * @param string | |
78 | */ | |
79 | public void addInclude(String string) | |
80 | { | |
81 | 0 | getIncludes().add( string ); |
82 | 0 | } //-- void addInclude(String) |
83 | ||
84 | /** | |
85 | * Get | |
86 | * When this is present, the plugin will include | |
87 | * the binaries of the | |
88 | * included modules from this set in the resulting | |
89 | * assembly. | |
90 | * | |
91 | */ | |
92 | public ModuleBinaries getBinaries() | |
93 | { | |
94 | 0 | return this.binaries; |
95 | } //-- ModuleBinaries getBinaries() | |
96 | ||
97 | /** | |
98 | * Method getExcludes | |
99 | */ | |
100 | public java.util.List getExcludes() | |
101 | { | |
102 | 0 | if ( this.excludes == null ) |
103 | { | |
104 | 0 | this.excludes = new java.util.ArrayList(); |
105 | } | |
106 | ||
107 | 0 | return this.excludes; |
108 | } //-- java.util.List getExcludes() | |
109 | ||
110 | /** | |
111 | * Method getIncludes | |
112 | */ | |
113 | public java.util.List getIncludes() | |
114 | { | |
115 | 0 | if ( this.includes == null ) |
116 | { | |
117 | 0 | this.includes = new java.util.ArrayList(); |
118 | } | |
119 | ||
120 | 0 | return this.includes; |
121 | } //-- java.util.List getIncludes() | |
122 | ||
123 | /** | |
124 | * Get | |
125 | * When this is present, the plugin will include | |
126 | * the source files of | |
127 | * the included modules from this set in the | |
128 | * resulting assembly. | |
129 | * | |
130 | */ | |
131 | public ModuleSources getSources() | |
132 | { | |
133 | 0 | return this.sources; |
134 | } //-- ModuleSources getSources() | |
135 | ||
136 | /** | |
137 | * Get | |
138 | * If set to false, the plugin will exclude | |
139 | * sub-modules from processing in this ModuleSet. | |
140 | * Otherwise, it will process all sub-modules, each | |
141 | * subject to include/exclude rules. | |
142 | * Default value is true. (Since 2.2) | |
143 | * | |
144 | */ | |
145 | public boolean isIncludeSubModules() | |
146 | { | |
147 | 0 | return this.includeSubModules; |
148 | } //-- boolean isIncludeSubModules() | |
149 | ||
150 | /** | |
151 | * Method removeExclude | |
152 | * | |
153 | * @param string | |
154 | */ | |
155 | public void removeExclude(String string) | |
156 | { | |
157 | 0 | getExcludes().remove( string ); |
158 | 0 | } //-- void removeExclude(String) |
159 | ||
160 | /** | |
161 | * Method removeInclude | |
162 | * | |
163 | * @param string | |
164 | */ | |
165 | public void removeInclude(String string) | |
166 | { | |
167 | 0 | getIncludes().remove( string ); |
168 | 0 | } //-- void removeInclude(String) |
169 | ||
170 | /** | |
171 | * Set | |
172 | * When this is present, the plugin will include | |
173 | * the binaries of the | |
174 | * included modules from this set in the resulting | |
175 | * assembly. | |
176 | * | |
177 | * | |
178 | * @param binaries | |
179 | */ | |
180 | public void setBinaries(ModuleBinaries binaries) | |
181 | { | |
182 | 0 | this.binaries = binaries; |
183 | 0 | } //-- void setBinaries(ModuleBinaries) |
184 | ||
185 | /** | |
186 | * Set | |
187 | * | |
188 | * This is a list of <exclude/> subelements, | |
189 | * each containing a | |
190 | * module reference of the type groupId:artifactId. | |
191 | * Modules matching | |
192 | * these elements will be excluded from this set. | |
193 | * | |
194 | * | |
195 | * | |
196 | * @param excludes | |
197 | */ | |
198 | public void setExcludes(java.util.List excludes) | |
199 | { | |
200 | 0 | this.excludes = excludes; |
201 | 0 | } //-- void setExcludes(java.util.List) |
202 | ||
203 | /** | |
204 | * Set | |
205 | * If set to false, the plugin will exclude | |
206 | * sub-modules from processing in this ModuleSet. | |
207 | * Otherwise, it will process all sub-modules, each | |
208 | * subject to include/exclude rules. | |
209 | * Default value is true. (Since 2.2) | |
210 | * | |
211 | * | |
212 | * @param includeSubModules | |
213 | */ | |
214 | public void setIncludeSubModules(boolean includeSubModules) | |
215 | { | |
216 | 0 | this.includeSubModules = includeSubModules; |
217 | 0 | } //-- void setIncludeSubModules(boolean) |
218 | ||
219 | /** | |
220 | * Set | |
221 | * | |
222 | * This is a list of <include/> subelements, | |
223 | * each containing a | |
224 | * module reference of the type groupId:artifactId. | |
225 | * Modules matching | |
226 | * these elements will be included in this set. If | |
227 | * none is present, | |
228 | * then <includes> represents all valid | |
229 | * values. | |
230 | * | |
231 | * | |
232 | * | |
233 | * @param includes | |
234 | */ | |
235 | public void setIncludes(java.util.List includes) | |
236 | { | |
237 | 0 | this.includes = includes; |
238 | 0 | } //-- void setIncludes(java.util.List) |
239 | ||
240 | /** | |
241 | * Set | |
242 | * When this is present, the plugin will include | |
243 | * the source files of | |
244 | * the included modules from this set in the | |
245 | * resulting assembly. | |
246 | * | |
247 | * | |
248 | * @param sources | |
249 | */ | |
250 | public void setSources(ModuleSources sources) | |
251 | { | |
252 | 0 | this.sources = sources; |
253 | 0 | } //-- void setSources(ModuleSources) |
254 | ||
255 | ||
256 | 0 | private String modelEncoding = "UTF-8"; |
257 | ||
258 | public void setModelEncoding( String modelEncoding ) | |
259 | { | |
260 | 0 | this.modelEncoding = modelEncoding; |
261 | 0 | } |
262 | ||
263 | public String getModelEncoding() | |
264 | { | |
265 | 0 | return modelEncoding; |
266 | }} |