View Javadoc
1   package org.apache.maven.plugin.assembly.mojos;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.io.File;
23  import java.util.Collections;
24  import java.util.List;
25  
26  import org.apache.maven.archiver.MavenArchiveConfiguration;
27  import org.apache.maven.artifact.repository.ArtifactRepository;
28  import org.apache.maven.execution.MavenSession;
29  import org.apache.maven.plugin.AbstractMojo;
30  import org.apache.maven.plugin.MojoExecutionException;
31  import org.apache.maven.plugin.MojoFailureException;
32  import org.apache.maven.plugin.assembly.AssemblerConfigurationSource;
33  import org.apache.maven.plugin.assembly.InvalidAssemblerConfigurationException;
34  import org.apache.maven.plugin.assembly.archive.ArchiveCreationException;
35  import org.apache.maven.plugin.assembly.archive.AssemblyArchiver;
36  import org.apache.maven.plugin.assembly.format.AssemblyFormattingException;
37  import org.apache.maven.plugin.assembly.io.AssemblyReadException;
38  import org.apache.maven.plugin.assembly.io.AssemblyReader;
39  import org.apache.maven.plugin.assembly.model.Assembly;
40  import org.apache.maven.plugin.assembly.utils.AssemblyFormatUtils;
41  import org.apache.maven.plugin.logging.Log;
42  import org.apache.maven.plugins.annotations.Component;
43  import org.apache.maven.plugins.annotations.Parameter;
44  import org.apache.maven.project.MavenProject;
45  import org.apache.maven.project.MavenProjectHelper;
46  import org.apache.maven.shared.filtering.MavenFileFilter;
47  import org.apache.maven.shared.filtering.MavenReaderFilter;
48  import org.codehaus.plexus.configuration.PlexusConfiguration;
49  
50  /**
51   * @author <a href="mailto:brett@apache.org">Brett Porter</a>
52   * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
53   * @version $Id: AbstractAssemblyMojo.java 1633832 2014-10-23 15:03:47Z krosenvold $
54   * @threadSafe
55   */
56  public abstract class AbstractAssemblyMojo
57      extends AbstractMojo
58      implements AssemblerConfigurationSource
59  {
60      /**
61       * The character encoding scheme to be applied when filtering resources.
62       */
63      @Parameter( property = "encoding", defaultValue = "${project.build.sourceEncoding}" )
64      private String encoding;
65  
66      /**
67       * Expressions preceded with this String won't be interpolated.
68       * If you use "\" as the escape string then \${foo} will be replaced with ${foo}.
69       *
70       * @since 2.4
71       */
72      @Parameter( property = "assembly.escapeString" )
73      private String escapeString;
74  
75      /**
76       * Flag allowing one or more executions of the assembly plugin to be configured as skipped for a particular build.
77       * This makes the assembly plugin more controllable from profiles.
78       */
79      @Parameter( property = "assembly.skipAssembly", defaultValue = "false" )
80      private boolean skipAssembly;
81  
82      /**
83       * If this flag is set, everything up to the call to Archiver.createArchive() will be executed.
84       */
85      @Parameter( property = "assembly.dryRun", defaultValue = "false" )
86      private boolean dryRun;
87  
88      /**
89       * If this flag is set, the ".dir" suffix will be suppressed in the output directory name when using assembly/format
90       * == 'dir' and other formats that begin with 'dir'. <br/>
91       * <b>NOTE:</b> Since 2.2-beta-3, the default-value for this is true, NOT false as it used to be.
92       */
93      @Parameter( defaultValue = "true" )
94      private boolean ignoreDirFormatExtensions;
95  
96      /**
97       * Local Maven repository where artifacts are cached during the build process.
98       */
99      @Parameter( defaultValue = "${localRepository}", required = true, readonly = true )
100     private ArtifactRepository localRepository;
101 
102     /**
103      */
104     @Parameter( defaultValue = "${project.remoteArtifactRepositories}", required = true, readonly = true )
105     private List<ArtifactRepository> remoteRepositories;
106 
107     /**
108      * Contains the full list of projects in the reactor.
109      */
110     @Parameter( defaultValue = "${reactorProjects}", required = true, readonly = true )
111     private List<MavenProject> reactorProjects;
112 
113     /**
114      * The output directory of the assembled distribution file.
115      */
116     @Parameter( defaultValue = "${project.build.directory}", required = true )
117     private File outputDirectory;
118 
119     /**
120      * The filename of the assembled distribution file.
121      */
122     @Parameter( defaultValue = "${project.build.finalName}", required = true )
123     private String finalName;
124 
125     /**
126      * Directory to unpack JARs into if needed
127      */
128     @Parameter( defaultValue = "${project.build.directory}/assembly/work", required = true )
129     private File workDirectory;
130 
131     /**
132      * Specifies the formats of the assembly.
133      * Multiple formats can be supplied and the Assembly Plugin will generate an archive for each desired formats.
134      * When deploying your project, all file formats specified will also be deployed. A format is specified by supplying
135      * one of the following
136      * values in a &lt;format&gt; subelement:
137      * <ul>
138      * <li><em>dir</em> - Creates a directory</li>
139      * <li><em>zip</em> - Creates a ZIP file format</li>
140      * <li><em>tar</em> - Creates a TAR format</li>
141      * <li><em>tar.gz</em> or <em>tgz</em> - Creates a gzip'd TAR format</li>
142      * <li><em>tar.bz2</em> or <em>tbz2</em> - Creates a bzip'd TAR format</li>
143      * </ul>
144      */
145     @Parameter
146     private List<String> formats;
147 
148     /**
149      * This is the artifact classifier to be used for the resultant assembly artifact. Normally, you would use the
150      * assembly-id instead of specifying this here.
151      *
152      * @deprecated Please use the Assembly's id for classifier instead
153      */
154     @Deprecated
155     @Parameter( property = "classifier" )
156     private String classifier;
157 
158     /**
159      * A list of descriptor files to generate from.
160      */
161     @Parameter
162     private String[] descriptors;
163 
164     /**
165      * A list of references to assembly descriptors available on the plugin's classpath. The default classpath
166      * includes these built-in descriptors: <code>bin</code>, <code>jar-with-dependencies</code>, <code>src</code>, and
167      * <code>project</code>. You can add others by adding dependencies
168      * to the plugin.
169      */
170     @Parameter
171     private String[] descriptorRefs;
172 
173     /**
174      * Directory to scan for descriptor files in. <b>NOTE:</b> This may not work correctly with assembly components.
175      */
176     @Parameter
177     private File descriptorSourceDirectory;
178 
179     /**
180      * This is the base directory from which archive files are created. This base directory pre-pended to any
181      * <code>&lt;directory&gt;</code> specifications in the assembly descriptor. This is an optional parameter.
182      */
183     @Parameter
184     private File archiveBaseDirectory;
185 
186     /**
187      * Predefined Assembly Descriptor Id's. You can select bin, jar-with-dependencies, or src.
188      *
189      * @deprecated Please use descriptorRefs instead
190      */
191     @Deprecated
192     @Parameter( property = "descriptorId" )
193     private String descriptorId;
194 
195     /**
196      * Assembly XML Descriptor file. This must be the path to your customized descriptor file.
197      *
198      * @deprecated Please use descriptors instead
199      */
200     @Deprecated
201     @Parameter( property = "descriptor" )
202     private String descriptor;
203 
204     /**
205      * Sets the TarArchiver behavior on file paths with more than 100 characters length. Valid values are: "warn"
206      * (default), "fail", "truncate", "gnu", "posix", "posix_warn" or "omit".
207      */
208     @Parameter( property = "assembly.tarLongFileMode", defaultValue = "warn" )
209     private String tarLongFileMode;
210 
211     /**
212      * Base directory of the project.
213      */
214     @Parameter( defaultValue = "${project.basedir}", required = true, readonly = true )
215     private File basedir;
216 
217     /**
218      * Maven ProjectHelper.
219      */
220     @Component
221     private MavenProjectHelper projectHelper;
222 
223     /**
224      * Maven shared filtering utility.
225      */
226     @Component
227     private MavenFileFilter mavenFileFilter;
228 
229     /**
230      * Maven shared filtering utility.
231      */
232     @Component
233     private MavenReaderFilter mavenReaderFilter;
234 
235     /**
236      * The Maven Session Object
237      */
238     @Parameter( defaultValue = "${session}", readonly = true, required = true )
239     private MavenSession mavenSession;
240 
241     /**
242      * Temporary directory that contain the files to be assembled.
243      */
244     @Parameter( defaultValue = "${project.build.directory}/archive-tmp", required = true, readonly = true )
245     private File tempRoot;
246 
247     /**
248      * Directory for site generated.
249      */
250     @Parameter( defaultValue = "${project.reporting.outputDirectory}", readonly = true )
251     private File siteDirectory;
252 
253     /**
254      * Set to true to include the site generated by site:site goal.
255      *
256      * @deprecated Please set this variable in the assembly descriptor instead
257      */
258     @Deprecated
259     @Parameter( property = "includeSite", defaultValue = "false" )
260     private boolean includeSite;
261 
262     /**
263      * Set to false to exclude the assembly id from the assembly final name.
264      */
265     @Parameter( property = "assembly.appendAssemblyId", defaultValue = "true" )
266     boolean appendAssemblyId;
267 
268     /**
269      * Set to true in order to not fail when a descriptor is missing.
270      */
271     @Parameter( property = "assembly.ignoreMissingDescriptor", defaultValue = "false" )
272     private boolean ignoreMissingDescriptor;
273 
274     /**
275      * This is a set of instructions to the archive builder, especially for building .jar files. It enables you to
276      * specify a Manifest file for the jar, in addition to other options.
277      * See <a href="http://maven.apache.org/shared/maven-archiver/index.html">Maven Archiver Reference</a>.
278      */
279     @Parameter
280     private MavenArchiveConfiguration archive;
281 
282     /**
283      * The list of extra filter properties files to be used along with System properties, project
284      * properties, and filter properties files specified in the POM build/filters section, which
285      * should be used for the filtering during the current mojo execution. <br/>
286      * Normally, these will be configured from a plugin's execution section, to provide a different
287      * set of filters for a particular execution.
288      */
289     @Parameter
290     private List<String> filters;
291 
292     /**
293      * If True (default) then the ${project.build.filters} are also used in addition to any
294      * further filters defined for the Assembly.
295      * 
296      * @since 2.4.2
297      */
298     @Parameter( property = "assembly.includeProjectBuildFilters", defaultValue = "true" )
299     private boolean includeProjectBuildFilters;
300 
301     /**
302      * Controls whether the assembly plugin tries to attach the resulting assembly to the project.
303      *
304      * @since 2.2-beta-1
305      */
306     @Parameter( property = "assembly.attach", defaultValue = "true" )
307     private boolean attach;
308 
309     /**
310      * Indicates if zip archives (jar,zip etc) being added to the assembly should be compressed again.
311      * Compressing again can result in smaller archive size, but gives noticeably longer execution time.
312      *
313      * @since 2.4
314      */
315     @Parameter( defaultValue = "true" )
316     private boolean recompressZippedFiles;
317 
318     /**
319      */
320     @Component
321     private AssemblyArchiver assemblyArchiver;
322 
323     /**
324      */
325     @Component
326     private AssemblyReader assemblyReader;
327 
328     /**
329      * Allows additional configuration options that are specific to a particular type of archive format. This is
330      * intended to capture an XML configuration that will be used to reflectively setup the options on the archiver
331      * instance. <br/>
332      * For instance, to direct an assembly with the "ear" format to use a particular deployment descriptor, you should
333      * specify the following for the archiverConfig value in your plugin configuration: <br/>
334      * <p/>
335      * 
336      * <pre>
337      * &lt;appxml&gt;${project.basedir}/somepath/app.xml&lt;/appxml&gt;
338      * </pre>
339      *
340      * @since 2.2-beta-3
341      */
342     @Parameter
343     private PlexusConfiguration archiverConfig;
344 
345     /**
346      * This will cause the assembly to run only at the top of a given module tree. That is, run in the project contained
347      * in the same folder where the mvn execution was launched.
348      *
349      * @since 2.2-beta-4
350      */
351     @Parameter( property = "assembly.runOnlyAtExecutionRoot", defaultValue = "false" )
352     private boolean runOnlyAtExecutionRoot;
353 
354     /**
355      * This will cause the assembly to only update an existing archive, if it exists.
356      * <p>
357      * <strong>Note:</strong> The property that can be used on the command line was misspelled as "assembly.updatOnly"
358      * in versions prior to version 2.4.
359      * </p>
360      *
361      * @since 2.2
362      */
363     @Parameter( property = "assembly.updateOnly", defaultValue = "false" )
364     private boolean updateOnly;
365 
366     /**
367      * <p>
368      * will use the jvm chmod, this is available for user and all level group level will be ignored As of
369      * assembly-plugin 2.5, this flag is ignored for users of java7+
370      * </p>
371      *
372      * @since 2.2
373      */
374     @Parameter( property = "assembly.useJvmChmod", defaultValue = "false" )
375     private boolean useJvmChmod;
376 
377     /**
378      * <p>
379      * Set to <code>true</code> in order to avoid all chmod calls.
380      * </p>
381      * <p/>
382      * <p>
383      * <b>NOTE:</b> This will cause the assembly plugin to <b>DISREGARD</b> all fileMode/directoryMode settings in the
384      * assembly descriptor, and all file permissions in unpacked dependencies!
385      * </p>
386      *
387      * @since 2.2
388      */
389     @Parameter( property = "assembly.ignorePermissions", defaultValue = "false" )
390     private boolean ignorePermissions;
391 
392     /**
393      * <p>
394      * Set of delimiters for expressions to filter within the resources. These delimiters are specified in the form
395      * 'beginToken*endToken'. If no '*' is given, the delimiter is assumed to be the same for start and end.
396      * </p>
397      * <p>
398      * So, the default filtering delimiters might be specified as:
399      * </p>
400      * 
401      * <pre>
402      * &lt;delimiters&gt;
403      *   &lt;delimiter&gt;${*}&lt;/delimiter&gt;
404      *   &lt;delimiter&gt;@&lt;/delimiter&gt;
405      * &lt;/delimiters&gt;
406      * </pre>
407      * <p>
408      * Since the '@' delimiter is the same on both ends, we don't need to specify '@*@' (though we can).
409      * </p>
410      *
411      * @since 2.4
412      */
413     @Parameter
414     private List<String> delimiters;
415 
416     /**
417      * Create the binary distribution.
418      * 
419      * @throws org.apache.maven.plugin.MojoExecutionException
420      */
421     public void execute()
422         throws MojoExecutionException, MojoFailureException
423     {
424         if ( skipAssembly )
425         {
426             getLog().info( "Assemblies have been skipped per configuration of the skipAssembly parameter." );
427             return;
428         }
429 
430         // run only at the execution root.
431         if ( runOnlyAtExecutionRoot && !isThisTheExecutionRoot() )
432         {
433             getLog().info( "Skipping the assembly in this project because it's not the Execution Root" );
434             return;
435         }
436 
437         List<Assembly> assemblies;
438         try
439         {
440             assemblies = assemblyReader.readAssemblies( this );
441         }
442         catch ( final AssemblyReadException e )
443         {
444             throw new MojoExecutionException( "Error reading assemblies: " + e.getMessage(), e );
445         }
446         catch ( final InvalidAssemblerConfigurationException e )
447         {
448             throw new MojoFailureException( assemblyReader, e.getMessage(), "Mojo configuration is invalid: "
449                 + e.getMessage() );
450         }
451 
452         // TODO: include dependencies marked for distribution under certain formats
453         // TODO: how, might we plug this into an installer, such as NSIS?
454 
455         boolean warnedAboutMainProjectArtifact = false;
456         for ( final Assembly assembly : assemblies )
457         {
458             try
459             {
460                 final String fullName = AssemblyFormatUtils.getDistributionName( assembly, this );
461 
462                 List<String> effectiveFormats = formats;
463                 if ( effectiveFormats == null || effectiveFormats.size() == 0 )
464                 {
465                     effectiveFormats = assembly.getFormats();
466                 }
467                 if ( effectiveFormats == null || effectiveFormats.size() == 0 )
468                 {
469                     throw new MojoFailureException(
470                                                     "No formats specified in the execution parameters or the assembly descriptor." );
471                 }
472 
473                 for ( final String format : effectiveFormats )
474                 {
475                     final File destFile =
476                         assemblyArchiver.createArchive( assembly, fullName, format, this, isRecompressZippedFiles() );
477 
478                     final MavenProject project = getProject();
479                     final String classifier = getClassifier();
480                     final String type = project.getArtifact().getType();
481 
482                     if ( attach && destFile.isFile() )
483                     {
484                         if ( isAssemblyIdAppended() )
485                         {
486                             projectHelper.attachArtifact( project, format, assembly.getId(), destFile );
487                         }
488                         else if ( classifier != null )
489                         {
490                             projectHelper.attachArtifact( project, format, classifier, destFile );
491                         }
492                         else if ( !"pom".equals( type ) && format.equals( type ) )
493                         {
494                             if ( !warnedAboutMainProjectArtifact )
495                             {
496                                 final StringBuilder message = new StringBuilder();
497 
498                                 message.append( "Configuration options: 'appendAssemblyId' is set to false, and 'classifier' is missing." );
499                                 message.append( "\nInstead of attaching the assembly file: " ).append( destFile ).append( ", it will become the file for main project artifact." );
500                                 message.append( "\nNOTE: If multiple descriptors or descriptor-formats are provided for this project, the value of this file will be non-deterministic!" );
501 
502                                 getLog().warn( message );
503                                 warnedAboutMainProjectArtifact = true;
504                             }
505 
506                             final File existingFile = project.getArtifact().getFile();
507                             if ( ( existingFile != null ) && existingFile.exists() )
508                             {
509                                 getLog().warn( "Replacing pre-existing project main-artifact file: " + existingFile
510                                                    + "\nwith assembly file: " + destFile );
511                             }
512 
513                             project.getArtifact().setFile( destFile );
514                         }
515                         else
516                         {
517                             projectHelper.attachArtifact( project, format, null, destFile );
518                         }
519                     }
520                     else if ( attach )
521                     {
522                         getLog().warn( "Assembly file: "
523                                            + destFile
524                                            + " is not a regular file (it may be a directory). It cannot be attached to the project build for installation or deployment." );
525                     }
526                 }
527             }
528             catch ( final ArchiveCreationException e )
529             {
530                 throw new MojoExecutionException( "Failed to create assembly: " + e.getMessage(), e );
531             }
532             catch ( final AssemblyFormattingException e )
533             {
534                 throw new MojoExecutionException( "Failed to create assembly: " + e.getMessage(), e );
535             }
536             catch ( final InvalidAssemblerConfigurationException e )
537             {
538                 throw new MojoFailureException( assembly, "Assembly is incorrectly configured: " + assembly.getId(),
539                                                 "Assembly: " + assembly.getId() + " is not configured correctly: "
540                                                     + e.getMessage() );
541             }
542         }
543     }
544 
545     /**
546      * Returns true if the current project is located at the Execution Root Directory (where mvn was launched)
547      * 
548      * @return if this is the execution root
549      */
550     boolean isThisTheExecutionRoot()
551     {
552         final Log log = getLog();
553         log.debug( "Root Folder:" + mavenSession.getExecutionRootDirectory() );
554         log.debug( "Current Folder:" + basedir );
555         final boolean result = mavenSession.getExecutionRootDirectory().equalsIgnoreCase( basedir.toString() );
556         if ( result )
557         {
558             log.debug( "This is the execution root." );
559         }
560         else
561         {
562             log.debug( "This is NOT the execution root." );
563         }
564 
565         return result;
566     }
567 
568     AssemblyArchiver getAssemblyArchiver()
569     {
570         return assemblyArchiver;
571     }
572 
573     AssemblyReader getAssemblyReader()
574     {
575         return assemblyReader;
576     }
577 
578     public File getBasedir()
579     {
580         return basedir;
581     }
582 
583     /**
584      * {@inheritDoc}
585      * 
586      * @deprecated This has been replaced by {@link #getDescriptors()}
587      */
588     @Deprecated
589     public String getDescriptor()
590     {
591         return descriptor;
592     }
593 
594     /**
595      * {@inheritDoc}
596      * 
597      * @deprecated This has been replaced by {@link #getDescriptorReferences()}
598      */
599     @Deprecated
600     public String getDescriptorId()
601     {
602         return descriptorId;
603     }
604 
605     public String[] getDescriptorReferences()
606     {
607         return descriptorRefs;
608     }
609 
610     public File getDescriptorSourceDirectory()
611     {
612         return descriptorSourceDirectory;
613     }
614 
615     public String[] getDescriptors()
616     {
617         return descriptors;
618     }
619 
620     public abstract MavenProject getProject();
621 
622     public File getSiteDirectory()
623     {
624         return siteDirectory;
625     }
626 
627     public boolean isSiteIncluded()
628     {
629         return includeSite;
630     }
631 
632     public String getFinalName()
633     {
634         return finalName;
635     }
636 
637     public boolean isAssemblyIdAppended()
638     {
639         return appendAssemblyId;
640     }
641 
642     public String getTarLongFileMode()
643     {
644         return tarLongFileMode;
645     }
646 
647     public File getOutputDirectory()
648     {
649         return outputDirectory;
650     }
651 
652     public MavenArchiveConfiguration getJarArchiveConfiguration()
653     {
654         return archive;
655     }
656 
657     public File getWorkingDirectory()
658     {
659         return workDirectory;
660     }
661 
662     public ArtifactRepository getLocalRepository()
663     {
664         return localRepository;
665     }
666 
667     public File getTemporaryRootDirectory()
668     {
669         return tempRoot;
670     }
671 
672     public File getArchiveBaseDirectory()
673     {
674         return archiveBaseDirectory;
675     }
676 
677     public List<String> getFilters()
678     {
679         if ( filters == null )
680         {
681             filters = getProject().getBuild().getFilters();
682             if ( filters == null )
683             {
684                 filters = Collections.emptyList();
685             }
686         }
687         return filters;
688     }
689 
690     public boolean isIncludeProjectBuildFilters()
691     {
692         return includeProjectBuildFilters;
693     }
694 
695     public List<MavenProject> getReactorProjects()
696     {
697         return reactorProjects;
698     }
699 
700     public String getClassifier()
701     {
702         // TODO Auto-generated method stub
703         return null;
704     }
705 
706     protected MavenProjectHelper getProjectHelper()
707     {
708         return projectHelper;
709     }
710 
711     public void setAppendAssemblyId( final boolean appendAssemblyId )
712     {
713         this.appendAssemblyId = appendAssemblyId;
714     }
715 
716     public void setArchive( final MavenArchiveConfiguration archive )
717     {
718         this.archive = archive;
719     }
720 
721 
722     public void setBasedir( final File basedir )
723     {
724         this.basedir = basedir;
725     }
726 
727     public void setClassifier( final String classifier )
728     {
729         this.classifier = classifier;
730     }
731 
732     /**
733      * {@inheritDoc}
734      * 
735      * @deprecated This has been replaced by {@link #setDescriptors(String[])}
736      */
737     @Deprecated
738     public void setDescriptor( final String descriptor )
739     {
740         this.descriptor = descriptor;
741     }
742 
743     /**
744      * {@inheritDoc}
745      * 
746      * @deprecated This has been replaced by {@link #setDescriptorRefs(String[])}
747      */
748     @Deprecated
749     public void setDescriptorId( final String descriptorId )
750     {
751         this.descriptorId = descriptorId;
752     }
753 
754     public void setDescriptorRefs( final String[] descriptorRefs )
755     {
756         this.descriptorRefs = descriptorRefs;
757     }
758 
759     public void setDescriptors( final String[] descriptors )
760     {
761         this.descriptors = descriptors;
762     }
763 
764     public void setDescriptorSourceDirectory( final File descriptorSourceDirectory )
765     {
766         this.descriptorSourceDirectory = descriptorSourceDirectory;
767     }
768 
769     public void setFilters( final List<String> filters )
770     {
771         this.filters = filters;
772     }
773 
774     public void setFinalName( final String finalName )
775     {
776         this.finalName = finalName;
777     }
778 
779     public void setIncludeSite( final boolean includeSite )
780     {
781         this.includeSite = includeSite;
782     }
783 
784     public void setLocalRepository( final ArtifactRepository localRepository )
785     {
786         this.localRepository = localRepository;
787     }
788 
789     public void setOutputDirectory( final File outputDirectory )
790     {
791         this.outputDirectory = outputDirectory;
792     }
793 
794     public void setProjectHelper( final MavenProjectHelper projectHelper )
795     {
796         this.projectHelper = projectHelper;
797     }
798 
799     public void setReactorProjects( final List<MavenProject> reactorProjects )
800     {
801         this.reactorProjects = reactorProjects;
802     }
803 
804     public void setSiteDirectory( final File siteDirectory )
805     {
806         this.siteDirectory = siteDirectory;
807     }
808 
809     public void setTarLongFileMode( final String tarLongFileMode )
810     {
811         this.tarLongFileMode = tarLongFileMode;
812     }
813 
814     public void setTempRoot( final File tempRoot )
815     {
816         this.tempRoot = tempRoot;
817     }
818 
819     public void setWorkDirectory( final File workDirectory )
820     {
821         this.workDirectory = workDirectory;
822     }
823 
824     public List<ArtifactRepository> getRemoteRepositories()
825     {
826         return remoteRepositories;
827     }
828 
829     public boolean isDryRun()
830     {
831         return dryRun;
832     }
833 
834     public boolean isIgnoreDirFormatExtensions()
835     {
836         return ignoreDirFormatExtensions;
837     }
838 
839     public boolean isIgnoreMissingDescriptor()
840     {
841         return ignoreMissingDescriptor;
842     }
843 
844     public void setIgnoreMissingDescriptor( final boolean ignoreMissingDescriptor )
845     {
846         this.ignoreMissingDescriptor = ignoreMissingDescriptor;
847     }
848 
849     public MavenSession getMavenSession()
850     {
851         return mavenSession;
852     }
853 
854     public String getArchiverConfig()
855     {
856         return archiverConfig == null ? null : archiverConfig.toString();
857     }
858 
859     public MavenFileFilter getMavenFileFilter()
860     {
861         return mavenFileFilter;
862     }
863 
864     public MavenReaderFilter getMavenReaderFilter()
865     {
866         return mavenReaderFilter;
867     }
868 
869     public boolean isUpdateOnly()
870     {
871         return updateOnly;
872     }
873 
874     public boolean isUseJvmChmod()
875     {
876         return useJvmChmod;
877     }
878 
879     public boolean isIgnorePermissions()
880     {
881         return ignorePermissions;
882     }
883 
884     public String getEncoding()
885     {
886         return encoding;
887     }
888 
889     boolean isRecompressZippedFiles()
890     {
891         return recompressZippedFiles;
892     }
893 
894     public String getEscapeString()
895     {
896         return escapeString;
897     }
898 
899     public List<String> getDelimiters()
900     {
901         return delimiters;
902     }
903 
904     public void setDelimiters( List<String> delimiters )
905     {
906         this.delimiters = delimiters;
907     }
908 
909 }