1 | |
package org.apache.maven.plugin.war; |
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
import org.apache.maven.archiver.MavenArchiveConfiguration; |
23 | |
import org.apache.maven.artifact.factory.ArtifactFactory; |
24 | |
import org.apache.maven.execution.MavenSession; |
25 | |
import org.apache.maven.model.Resource; |
26 | |
import org.apache.maven.plugin.AbstractMojo; |
27 | |
import org.apache.maven.plugin.MojoExecutionException; |
28 | |
import org.apache.maven.plugin.MojoFailureException; |
29 | |
import org.apache.maven.plugin.logging.Log; |
30 | |
import org.apache.maven.plugin.war.overlay.OverlayManager; |
31 | |
import org.apache.maven.plugin.war.packaging.DependenciesAnalysisPackagingTask; |
32 | |
import org.apache.maven.plugin.war.packaging.OverlayPackagingTask; |
33 | |
import org.apache.maven.plugin.war.packaging.SaveWebappStructurePostPackagingTask; |
34 | |
import org.apache.maven.plugin.war.packaging.WarPackagingContext; |
35 | |
import org.apache.maven.plugin.war.packaging.WarPackagingTask; |
36 | |
import org.apache.maven.plugin.war.packaging.WarPostPackagingTask; |
37 | |
import org.apache.maven.plugin.war.packaging.WarProjectPackagingTask; |
38 | |
import org.apache.maven.plugin.war.util.WebappStructure; |
39 | |
import org.apache.maven.plugin.war.util.WebappStructureSerializer; |
40 | |
import org.apache.maven.plugins.annotations.Component; |
41 | |
import org.apache.maven.plugins.annotations.Parameter; |
42 | |
import org.apache.maven.project.MavenProject; |
43 | |
import org.apache.maven.shared.filtering.MavenFileFilter; |
44 | |
import org.apache.maven.shared.filtering.MavenFilteringException; |
45 | |
import org.apache.maven.shared.filtering.MavenResourcesExecution; |
46 | |
import org.apache.maven.shared.filtering.MavenResourcesFiltering; |
47 | |
import org.codehaus.plexus.archiver.Archiver; |
48 | |
import org.codehaus.plexus.archiver.jar.JarArchiver; |
49 | |
import org.codehaus.plexus.archiver.manager.ArchiverManager; |
50 | |
import org.codehaus.plexus.util.FileUtils; |
51 | |
import org.codehaus.plexus.util.StringUtils; |
52 | |
|
53 | |
import java.io.File; |
54 | |
import java.io.IOException; |
55 | |
import java.util.ArrayList; |
56 | |
import java.util.Arrays; |
57 | |
import java.util.Collections; |
58 | |
import java.util.List; |
59 | |
|
60 | |
|
61 | |
|
62 | |
|
63 | |
|
64 | |
|
65 | 1884 | public abstract class AbstractWarMojo |
66 | |
extends AbstractMojo |
67 | |
{ |
68 | |
public static final String DEFAULT_FILE_NAME_MAPPING = "@{artifactId}@-@{version}@.@{extension}@"; |
69 | |
|
70 | |
public static final String DEFAULT_FILE_NAME_MAPPING_CLASSIFIER = |
71 | |
"@{artifactId}@-@{version}@-@{classifier}@.@{extension}@"; |
72 | |
|
73 | 2 | private static final String[] EMPTY_STRING_ARRAY = {}; |
74 | |
|
75 | |
private static final String META_INF = "META-INF"; |
76 | |
|
77 | |
private static final String WEB_INF = "WEB-INF"; |
78 | |
|
79 | |
|
80 | |
|
81 | |
|
82 | |
@Component |
83 | |
private MavenProject project; |
84 | |
|
85 | |
|
86 | |
|
87 | |
|
88 | |
@Parameter( defaultValue = "${project.build.outputDirectory}", required = true, readonly = true ) |
89 | |
private File classesDirectory; |
90 | |
|
91 | |
|
92 | |
|
93 | |
|
94 | |
|
95 | |
|
96 | |
|
97 | |
|
98 | |
@Parameter( property = "archiveClasses", defaultValue = "false" ) |
99 | |
private boolean archiveClasses; |
100 | |
|
101 | |
|
102 | |
|
103 | |
|
104 | |
|
105 | |
|
106 | |
@Parameter( property = "resourceEncoding", defaultValue = "${project.build.sourceEncoding}" ) |
107 | |
private String resourceEncoding; |
108 | |
|
109 | |
|
110 | |
|
111 | |
|
112 | |
@Component( role = Archiver.class, hint = "jar" ) |
113 | |
private JarArchiver jarArchiver; |
114 | |
|
115 | |
|
116 | |
|
117 | |
|
118 | |
@Parameter( defaultValue = "${project.build.directory}/${project.build.finalName}", required = true ) |
119 | |
private File webappDirectory; |
120 | |
|
121 | |
|
122 | |
|
123 | |
|
124 | |
|
125 | |
@Parameter( defaultValue = "${basedir}/src/main/webapp", required = true ) |
126 | |
private File warSourceDirectory; |
127 | |
|
128 | |
|
129 | |
|
130 | |
|
131 | |
@Parameter |
132 | |
private Resource[] webResources; |
133 | |
|
134 | |
|
135 | |
|
136 | |
|
137 | |
@Parameter |
138 | |
private List<String> filters; |
139 | |
|
140 | |
|
141 | |
|
142 | |
|
143 | |
@Parameter( property = "maven.war.webxml" ) |
144 | |
private File webXml; |
145 | |
|
146 | |
|
147 | |
|
148 | |
|
149 | |
|
150 | |
|
151 | |
|
152 | |
@Parameter( property = "maven.war.containerConfigXML" ) |
153 | |
private File containerConfigXML; |
154 | |
|
155 | |
|
156 | |
|
157 | |
|
158 | |
@Parameter( defaultValue = "${project.build.directory}/war/work", required = true ) |
159 | |
private File workDirectory; |
160 | |
|
161 | |
|
162 | |
|
163 | |
|
164 | |
|
165 | |
|
166 | |
|
167 | |
@Parameter |
168 | |
private String outputFileNameMapping; |
169 | |
|
170 | |
|
171 | |
|
172 | |
|
173 | |
|
174 | |
|
175 | |
@Parameter( defaultValue = "${project.build.directory}/war/work/webapp-cache.xml", required = true ) |
176 | |
private File cacheFile; |
177 | |
|
178 | |
|
179 | |
|
180 | |
|
181 | |
|
182 | |
|
183 | |
|
184 | |
@Parameter( property = "useCache", defaultValue = "false" ) |
185 | 126 | private boolean useCache = false; |
186 | |
|
187 | |
|
188 | |
|
189 | |
@Component( role = ArtifactFactory.class ) |
190 | |
private ArtifactFactory artifactFactory; |
191 | |
|
192 | |
|
193 | |
|
194 | |
|
195 | |
@Component( role = ArchiverManager.class ) |
196 | |
private ArchiverManager archiverManager; |
197 | |
|
198 | |
|
199 | |
|
200 | |
@Component( role = MavenFileFilter.class, hint = "default" ) |
201 | |
private MavenFileFilter mavenFileFilter; |
202 | |
|
203 | |
|
204 | |
|
205 | |
@Component( role = MavenResourcesFiltering.class, hint = "default" ) |
206 | |
private MavenResourcesFiltering mavenResourcesFiltering; |
207 | |
|
208 | |
|
209 | |
|
210 | |
|
211 | |
|
212 | |
@Parameter( alias = "includes", defaultValue = "**" ) |
213 | |
private String warSourceIncludes; |
214 | |
|
215 | |
|
216 | |
|
217 | |
|
218 | |
|
219 | |
@Parameter( alias = "excludes" ) |
220 | |
private String warSourceExcludes; |
221 | |
|
222 | |
|
223 | |
|
224 | |
|
225 | |
|
226 | |
|
227 | |
|
228 | |
|
229 | |
@Parameter |
230 | 126 | private String dependentWarIncludes = "**/**"; |
231 | |
|
232 | |
|
233 | |
|
234 | |
|
235 | |
|
236 | |
|
237 | |
|
238 | |
@Parameter |
239 | 126 | private String dependentWarExcludes = "META-INF/**"; |
240 | |
|
241 | |
|
242 | |
|
243 | |
|
244 | |
|
245 | |
|
246 | |
|
247 | |
|
248 | |
|
249 | |
|
250 | |
|
251 | |
|
252 | |
|
253 | |
|
254 | |
|
255 | |
|
256 | |
|
257 | |
|
258 | |
|
259 | |
|
260 | |
|
261 | |
|
262 | |
|
263 | |
@Parameter |
264 | 126 | private List<Overlay> overlays = new ArrayList<Overlay>(); |
265 | |
|
266 | |
|
267 | |
|
268 | |
|
269 | |
|
270 | |
|
271 | |
|
272 | |
@Parameter |
273 | |
private List<String> nonFilteredFileExtensions; |
274 | |
|
275 | |
|
276 | |
|
277 | |
|
278 | |
@Component |
279 | |
private MavenSession session; |
280 | |
|
281 | |
|
282 | |
|
283 | |
|
284 | |
|
285 | |
|
286 | |
@Parameter( property = "maven.war.filteringDeploymentDescriptors", defaultValue = "false" ) |
287 | 126 | private boolean filteringDeploymentDescriptors = false; |
288 | |
|
289 | |
|
290 | |
|
291 | |
|
292 | |
|
293 | |
|
294 | |
|
295 | |
@Parameter( property = "maven.war.escapedBackslashesInFilePath", defaultValue = "false" ) |
296 | 126 | private boolean escapedBackslashesInFilePath = false; |
297 | |
|
298 | |
|
299 | |
|
300 | |
|
301 | |
|
302 | |
|
303 | |
|
304 | |
@Parameter( property = "maven.war.escapeString" ) |
305 | |
protected String escapeString; |
306 | |
|
307 | |
|
308 | |
|
309 | |
|
310 | |
|
311 | |
|
312 | |
|
313 | |
|
314 | |
@Parameter( defaultValue = "false" ) |
315 | |
private boolean recompressZippedFiles; |
316 | |
|
317 | |
|
318 | |
|
319 | |
|
320 | |
|
321 | |
@Parameter |
322 | 126 | private MavenArchiveConfiguration archive = new MavenArchiveConfiguration(); |
323 | |
|
324 | 126 | private final WebappStructureSerializer webappStructureSerialier = new WebappStructureSerializer(); |
325 | |
|
326 | 126 | private final Overlay currentProjectOverlay = Overlay.createInstance(); |
327 | |
|
328 | |
|
329 | |
public Overlay getCurrentProjectOverlay() |
330 | |
{ |
331 | 6 | return currentProjectOverlay; |
332 | |
} |
333 | |
|
334 | |
|
335 | |
|
336 | |
|
337 | |
|
338 | |
|
339 | |
|
340 | |
protected String[] getExcludes() |
341 | |
{ |
342 | 122 | List<String> excludeList = new ArrayList<String>(); |
343 | 122 | if ( StringUtils.isNotEmpty( warSourceExcludes ) ) |
344 | |
{ |
345 | 2 | excludeList.addAll( Arrays.asList( StringUtils.split( warSourceExcludes, "," ) ) ); |
346 | |
} |
347 | |
|
348 | |
|
349 | 122 | if ( webXml != null && StringUtils.isNotEmpty( webXml.getName() ) ) |
350 | |
{ |
351 | 46 | excludeList.add( "**/" + WEB_INF + "/web.xml" ); |
352 | |
} |
353 | |
|
354 | |
|
355 | 122 | if ( containerConfigXML != null && StringUtils.isNotEmpty( containerConfigXML.getName() ) ) |
356 | |
{ |
357 | 4 | excludeList.add( "**/" + META_INF + "/" + containerConfigXML.getName() ); |
358 | |
} |
359 | |
|
360 | 122 | return (String[]) excludeList.toArray( EMPTY_STRING_ARRAY ); |
361 | |
} |
362 | |
|
363 | |
|
364 | |
|
365 | |
|
366 | |
|
367 | |
|
368 | |
|
369 | |
protected String[] getIncludes() |
370 | |
{ |
371 | 122 | return StringUtils.split( StringUtils.defaultString( warSourceIncludes ), "," ); |
372 | |
} |
373 | |
|
374 | |
|
375 | |
|
376 | |
|
377 | |
|
378 | |
|
379 | |
|
380 | |
protected String[] getDependentWarExcludes() |
381 | |
{ |
382 | |
String[] excludes; |
383 | 0 | if ( StringUtils.isNotEmpty( dependentWarExcludes ) ) |
384 | |
{ |
385 | 0 | excludes = StringUtils.split( dependentWarExcludes, "," ); |
386 | |
} |
387 | |
else |
388 | |
{ |
389 | 0 | excludes = EMPTY_STRING_ARRAY; |
390 | |
} |
391 | 0 | return excludes; |
392 | |
} |
393 | |
|
394 | |
|
395 | |
|
396 | |
|
397 | |
|
398 | |
|
399 | |
|
400 | |
protected String[] getDependentWarIncludes() |
401 | |
{ |
402 | 0 | return StringUtils.split( StringUtils.defaultString( dependentWarIncludes ), "," ); |
403 | |
} |
404 | |
|
405 | |
public void buildExplodedWebapp( File webappDirectory ) |
406 | |
throws MojoExecutionException, MojoFailureException |
407 | |
{ |
408 | 124 | webappDirectory.mkdirs(); |
409 | |
|
410 | |
try |
411 | |
{ |
412 | 124 | buildWebapp( project, webappDirectory ); |
413 | |
} |
414 | 0 | catch ( IOException e ) |
415 | |
{ |
416 | 0 | throw new MojoExecutionException( "Could not build webapp", e ); |
417 | 124 | } |
418 | 124 | } |
419 | |
|
420 | |
|
421 | |
|
422 | |
|
423 | |
|
424 | |
|
425 | |
|
426 | |
|
427 | |
|
428 | |
|
429 | |
|
430 | |
|
431 | |
|
432 | |
|
433 | |
|
434 | |
@SuppressWarnings( "unchecked" ) |
435 | |
public void buildWebapp( MavenProject project, File webappDirectory ) |
436 | |
throws MojoExecutionException, MojoFailureException, IOException |
437 | |
{ |
438 | |
|
439 | |
WebappStructure cache; |
440 | 124 | if ( useCache && cacheFile.exists() ) |
441 | |
{ |
442 | 16 | cache = new WebappStructure( project.getDependencies(), webappStructureSerialier.fromXml( cacheFile ) ); |
443 | |
} |
444 | |
else |
445 | |
{ |
446 | 108 | cache = new WebappStructure( project.getDependencies(), null ); |
447 | |
} |
448 | |
|
449 | 124 | final long startTime = System.currentTimeMillis(); |
450 | 124 | getLog().info( "Assembling webapp [" + project.getArtifactId() + "] in [" + webappDirectory + "]" ); |
451 | |
|
452 | 124 | final OverlayManager overlayManager = |
453 | |
new OverlayManager( overlays, project, dependentWarIncludes, dependentWarExcludes, currentProjectOverlay ); |
454 | 124 | final List<WarPackagingTask> packagingTasks = getPackagingTasks( overlayManager ); |
455 | 124 | List<FileUtils.FilterWrapper> defaultFilterWrappers = null; |
456 | |
try |
457 | |
{ |
458 | 124 | MavenResourcesExecution mavenResourcesExecution = new MavenResourcesExecution(); |
459 | 124 | mavenResourcesExecution.setEscapeString( escapeString ); |
460 | |
|
461 | 124 | defaultFilterWrappers = mavenFileFilter.getDefaultFilterWrappers( project, filters, |
462 | |
escapedBackslashesInFilePath, |
463 | |
this.session, mavenResourcesExecution ); |
464 | |
|
465 | |
} |
466 | 0 | catch ( MavenFilteringException e ) |
467 | |
{ |
468 | 0 | getLog().error( "fail to build filering wrappers " + e.getMessage() ); |
469 | 0 | throw new MojoExecutionException( e.getMessage(), e ); |
470 | 124 | } |
471 | |
|
472 | 124 | final WarPackagingContext context = new DefaultWarPackagingContext( webappDirectory, cache, overlayManager, |
473 | |
defaultFilterWrappers, |
474 | |
getNonFilteredFileExtensions(), |
475 | |
filteringDeploymentDescriptors, |
476 | |
this.artifactFactory, resourceEncoding); |
477 | 124 | for ( WarPackagingTask warPackagingTask : packagingTasks ) |
478 | |
{ |
479 | 216 | warPackagingTask.performPackaging( context ); |
480 | |
} |
481 | |
|
482 | |
|
483 | 124 | final List<WarPostPackagingTask> postPackagingTasks = getPostPackagingTasks(); |
484 | 124 | for( WarPostPackagingTask task : postPackagingTasks ) |
485 | |
{ |
486 | 24 | task.performPostPackaging( context ); |
487 | |
} |
488 | 124 | getLog().info( "Webapp assembled in [" + ( System.currentTimeMillis() - startTime ) + " msecs]" ); |
489 | |
|
490 | 124 | } |
491 | |
|
492 | |
|
493 | |
|
494 | |
|
495 | |
|
496 | |
|
497 | |
|
498 | |
|
499 | |
|
500 | |
private List<WarPackagingTask> getPackagingTasks( OverlayManager overlayManager ) |
501 | |
throws MojoExecutionException |
502 | |
{ |
503 | 124 | final List<WarPackagingTask> packagingTasks = new ArrayList<WarPackagingTask>(); |
504 | 124 | if ( useCache ) |
505 | |
{ |
506 | 24 | packagingTasks.add( new DependenciesAnalysisPackagingTask() ); |
507 | |
} |
508 | |
|
509 | 124 | final List<Overlay> resolvedOverlays = overlayManager.getOverlays(); |
510 | 124 | for ( Overlay overlay : resolvedOverlays ) |
511 | |
{ |
512 | 192 | if ( overlay.isCurrentProject() ) |
513 | |
{ |
514 | 124 | packagingTasks.add( new WarProjectPackagingTask( webResources, webXml, containerConfigXML, |
515 | |
currentProjectOverlay ) ); |
516 | |
} |
517 | |
else |
518 | |
{ |
519 | 68 | packagingTasks.add( new OverlayPackagingTask( overlay, currentProjectOverlay ) ); |
520 | |
} |
521 | |
} |
522 | 124 | return packagingTasks; |
523 | |
} |
524 | |
|
525 | |
|
526 | |
|
527 | |
|
528 | |
|
529 | |
|
530 | |
|
531 | |
|
532 | |
private List<WarPostPackagingTask> getPostPackagingTasks() |
533 | |
{ |
534 | 124 | final List<WarPostPackagingTask> postPackagingTasks = new ArrayList<WarPostPackagingTask>(); |
535 | 124 | if ( useCache ) |
536 | |
{ |
537 | 24 | postPackagingTasks.add( new SaveWebappStructurePostPackagingTask( cacheFile ) ); |
538 | |
} |
539 | |
|
540 | 124 | return postPackagingTasks; |
541 | |
} |
542 | |
|
543 | |
|
544 | |
|
545 | |
|
546 | 126 | private class DefaultWarPackagingContext |
547 | |
implements WarPackagingContext |
548 | |
{ |
549 | |
|
550 | |
private final ArtifactFactory artifactFactory; |
551 | |
|
552 | |
private final String resourceEncoding; |
553 | |
|
554 | |
private final WebappStructure webappStructure; |
555 | |
|
556 | |
private final File webappDirectory; |
557 | |
|
558 | |
private final OverlayManager overlayManager; |
559 | |
|
560 | |
private final List<FileUtils.FilterWrapper> filterWrappers; |
561 | |
|
562 | |
private List<String> nonFilteredFileExtensions; |
563 | |
|
564 | |
private boolean filteringDeploymentDescriptors; |
565 | |
|
566 | |
public DefaultWarPackagingContext( File webappDirectory, final WebappStructure webappStructure, |
567 | |
final OverlayManager overlayManager, List<FileUtils.FilterWrapper> filterWrappers, |
568 | |
List<String> nonFilteredFileExtensions, boolean filteringDeploymentDescriptors, |
569 | |
ArtifactFactory artifactFactory, String resourceEncoding ) |
570 | 124 | { |
571 | 124 | this.webappDirectory = webappDirectory; |
572 | 124 | this.webappStructure = webappStructure; |
573 | 124 | this.overlayManager = overlayManager; |
574 | 124 | this.filterWrappers = filterWrappers; |
575 | 124 | this.artifactFactory = artifactFactory; |
576 | 124 | this.filteringDeploymentDescriptors = filteringDeploymentDescriptors; |
577 | 124 | this.nonFilteredFileExtensions = nonFilteredFileExtensions == null ? Collections.<String>emptyList() |
578 | |
: nonFilteredFileExtensions; |
579 | 124 | this.resourceEncoding = resourceEncoding; |
580 | |
|
581 | |
|
582 | 124 | for ( String overlayId : overlayManager.getOverlayIds() ) |
583 | |
{ |
584 | 192 | webappStructure.getStructure( overlayId ); |
585 | |
} |
586 | 124 | } |
587 | |
|
588 | |
public MavenProject getProject() |
589 | |
{ |
590 | 124 | return project; |
591 | |
} |
592 | |
|
593 | |
public File getWebappDirectory() |
594 | |
{ |
595 | 1274 | return webappDirectory; |
596 | |
} |
597 | |
|
598 | |
public File getClassesDirectory() |
599 | |
{ |
600 | 496 | return classesDirectory; |
601 | |
} |
602 | |
|
603 | |
public Log getLog() |
604 | |
{ |
605 | 2020 | return AbstractWarMojo.this.getLog(); |
606 | |
} |
607 | |
|
608 | |
public String getOutputFileNameMapping() |
609 | |
{ |
610 | 232 | return outputFileNameMapping; |
611 | |
} |
612 | |
|
613 | |
public File getWebappSourceDirectory() |
614 | |
{ |
615 | 692 | return warSourceDirectory; |
616 | |
} |
617 | |
|
618 | |
public String[] getWebappSourceIncludes() |
619 | |
{ |
620 | 122 | return getIncludes(); |
621 | |
} |
622 | |
|
623 | |
public String[] getWebappSourceExcludes() |
624 | |
{ |
625 | 122 | return getExcludes(); |
626 | |
} |
627 | |
|
628 | |
public boolean archiveClasses() |
629 | |
{ |
630 | 124 | return archiveClasses; |
631 | |
} |
632 | |
|
633 | |
public File getOverlaysWorkDirectory() |
634 | |
{ |
635 | 66 | return workDirectory; |
636 | |
} |
637 | |
|
638 | |
public ArchiverManager getArchiverManager() |
639 | |
{ |
640 | 0 | return archiverManager; |
641 | |
} |
642 | |
|
643 | |
public MavenArchiveConfiguration getArchive() |
644 | |
{ |
645 | 0 | return archive; |
646 | |
} |
647 | |
|
648 | |
public JarArchiver getJarArchiver() |
649 | |
{ |
650 | 0 | return jarArchiver; |
651 | |
} |
652 | |
|
653 | |
public List<String> getFilters() |
654 | |
{ |
655 | 0 | return filters; |
656 | |
} |
657 | |
|
658 | |
public WebappStructure getWebappStructure() |
659 | |
{ |
660 | 1074 | return webappStructure; |
661 | |
} |
662 | |
|
663 | |
public List<String> getOwnerIds() |
664 | |
{ |
665 | 0 | return overlayManager.getOverlayIds(); |
666 | |
} |
667 | |
|
668 | |
public MavenFileFilter getMavenFileFilter() |
669 | |
{ |
670 | 12 | return mavenFileFilter; |
671 | |
} |
672 | |
|
673 | |
public List<FileUtils.FilterWrapper> getFilterWrappers() |
674 | |
{ |
675 | 12 | return filterWrappers; |
676 | |
} |
677 | |
|
678 | |
public boolean isNonFilteredExtension( String fileName ) |
679 | |
{ |
680 | 12 | return !mavenResourcesFiltering.filteredFileExtension( fileName, nonFilteredFileExtensions ); |
681 | |
} |
682 | |
|
683 | |
public boolean isFilteringDeploymentDescriptors() |
684 | |
{ |
685 | 50 | return filteringDeploymentDescriptors; |
686 | |
} |
687 | |
|
688 | |
public ArtifactFactory getArtifactFactory() |
689 | |
{ |
690 | 0 | return this.artifactFactory; |
691 | |
} |
692 | |
|
693 | |
public MavenSession getSession() |
694 | |
{ |
695 | 0 | return session; |
696 | |
} |
697 | |
|
698 | |
public String getResourceEncoding() |
699 | |
{ |
700 | 12 | return resourceEncoding; |
701 | |
} |
702 | |
} |
703 | |
|
704 | |
public MavenProject getProject() |
705 | |
{ |
706 | 78 | return project; |
707 | |
} |
708 | |
|
709 | |
public void setProject( MavenProject project ) |
710 | |
{ |
711 | 128 | this.project = project; |
712 | 128 | } |
713 | |
|
714 | |
public File getClassesDirectory() |
715 | |
{ |
716 | 0 | return classesDirectory; |
717 | |
} |
718 | |
|
719 | |
public void setClassesDirectory( File classesDirectory ) |
720 | |
{ |
721 | 116 | this.classesDirectory = classesDirectory; |
722 | 116 | } |
723 | |
|
724 | |
public File getWebappDirectory() |
725 | |
{ |
726 | 186 | return webappDirectory; |
727 | |
} |
728 | |
|
729 | |
public void setWebappDirectory( File webappDirectory ) |
730 | |
{ |
731 | 116 | this.webappDirectory = webappDirectory; |
732 | 116 | } |
733 | |
|
734 | |
public File getWarSourceDirectory() |
735 | |
{ |
736 | 14 | return warSourceDirectory; |
737 | |
} |
738 | |
|
739 | |
public void setWarSourceDirectory( File warSourceDirectory ) |
740 | |
{ |
741 | 128 | this.warSourceDirectory = warSourceDirectory; |
742 | 128 | } |
743 | |
|
744 | |
public File getWebXml() |
745 | |
{ |
746 | 16 | return webXml; |
747 | |
} |
748 | |
|
749 | |
public void setWebXml( File webXml ) |
750 | |
{ |
751 | 38 | this.webXml = webXml; |
752 | 38 | } |
753 | |
|
754 | |
public File getContainerConfigXML() |
755 | |
{ |
756 | 0 | return containerConfigXML; |
757 | |
} |
758 | |
|
759 | |
public void setContainerConfigXML( File containerConfigXML ) |
760 | |
{ |
761 | 4 | this.containerConfigXML = containerConfigXML; |
762 | 4 | } |
763 | |
|
764 | |
public String getOutputFileNameMapping() |
765 | |
{ |
766 | 0 | return outputFileNameMapping; |
767 | |
} |
768 | |
|
769 | |
public void setOutputFileNameMapping( String outputFileNameMapping ) |
770 | |
{ |
771 | 4 | this.outputFileNameMapping = outputFileNameMapping; |
772 | 4 | } |
773 | |
|
774 | |
public List<Overlay> getOverlays() |
775 | |
{ |
776 | 0 | return overlays; |
777 | |
} |
778 | |
|
779 | |
public void setOverlays( List<Overlay> overlays ) |
780 | |
{ |
781 | 16 | this.overlays = overlays; |
782 | 16 | } |
783 | |
|
784 | |
public void addOverlay( Overlay overlay ) |
785 | |
{ |
786 | 26 | overlays.add( overlay ); |
787 | 26 | } |
788 | |
|
789 | |
public boolean isArchiveClasses() |
790 | |
{ |
791 | 4 | return archiveClasses; |
792 | |
} |
793 | |
|
794 | |
public void setArchiveClasses( boolean archiveClasses ) |
795 | |
{ |
796 | 0 | this.archiveClasses = archiveClasses; |
797 | 0 | } |
798 | |
|
799 | |
public JarArchiver getJarArchiver() |
800 | |
{ |
801 | 4 | return jarArchiver; |
802 | |
} |
803 | |
|
804 | |
public void setJarArchiver( JarArchiver jarArchiver ) |
805 | |
{ |
806 | 0 | this.jarArchiver = jarArchiver; |
807 | 0 | } |
808 | |
|
809 | |
public Resource[] getWebResources() |
810 | |
{ |
811 | 0 | return webResources; |
812 | |
} |
813 | |
|
814 | |
public void setWebResources( Resource[] webResources ) |
815 | |
{ |
816 | 0 | this.webResources = webResources; |
817 | 0 | } |
818 | |
|
819 | |
public List<String> getFilters() |
820 | |
{ |
821 | 0 | return filters; |
822 | |
} |
823 | |
|
824 | |
public void setFilters( List<String> filters ) |
825 | |
{ |
826 | 0 | this.filters = filters; |
827 | 0 | } |
828 | |
|
829 | |
public File getWorkDirectory() |
830 | |
{ |
831 | 28 | return workDirectory; |
832 | |
} |
833 | |
|
834 | |
public void setWorkDirectory( File workDirectory ) |
835 | |
{ |
836 | 0 | this.workDirectory = workDirectory; |
837 | 0 | } |
838 | |
|
839 | |
public File getCacheFile() |
840 | |
{ |
841 | 0 | return cacheFile; |
842 | |
} |
843 | |
|
844 | |
public void setCacheFile( File cacheFile ) |
845 | |
{ |
846 | 0 | this.cacheFile = cacheFile; |
847 | 0 | } |
848 | |
|
849 | |
public String getWarSourceIncludes() |
850 | |
{ |
851 | 0 | return warSourceIncludes; |
852 | |
} |
853 | |
|
854 | |
public void setWarSourceIncludes( String warSourceIncludes ) |
855 | |
{ |
856 | 0 | this.warSourceIncludes = warSourceIncludes; |
857 | 0 | } |
858 | |
|
859 | |
public String getWarSourceExcludes() |
860 | |
{ |
861 | 0 | return warSourceExcludes; |
862 | |
} |
863 | |
|
864 | |
public void setWarSourceExcludes( String warSourceExcludes ) |
865 | |
{ |
866 | 0 | this.warSourceExcludes = warSourceExcludes; |
867 | 0 | } |
868 | |
|
869 | |
|
870 | |
public boolean isUseCache() |
871 | |
{ |
872 | 0 | return useCache; |
873 | |
} |
874 | |
|
875 | |
public void setUseCache( boolean useCache ) |
876 | |
{ |
877 | 8 | this.useCache = useCache; |
878 | 8 | } |
879 | |
|
880 | |
public MavenArchiveConfiguration getArchive() |
881 | |
{ |
882 | 44 | return archive; |
883 | |
} |
884 | |
|
885 | |
public List<String> getNonFilteredFileExtensions() |
886 | |
{ |
887 | 124 | return nonFilteredFileExtensions; |
888 | |
} |
889 | |
|
890 | |
public void setNonFilteredFileExtensions( List<String> nonFilteredFileExtensions ) |
891 | |
{ |
892 | 0 | this.nonFilteredFileExtensions = nonFilteredFileExtensions; |
893 | 0 | } |
894 | |
|
895 | |
public ArtifactFactory getArtifactFactory() |
896 | |
{ |
897 | 0 | return this.artifactFactory; |
898 | |
} |
899 | |
|
900 | |
public void setArtifactFactory( ArtifactFactory artifactFactory ) |
901 | |
{ |
902 | 0 | this.artifactFactory = artifactFactory; |
903 | 0 | } |
904 | |
|
905 | |
protected MavenSession getSession() |
906 | |
{ |
907 | 44 | return this.session; |
908 | |
} |
909 | |
|
910 | |
protected boolean isRecompressZippedFiles() |
911 | |
{ |
912 | 30 | return recompressZippedFiles; |
913 | |
} |
914 | |
} |