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 org.apache.maven.archiver.MavenArchiveConfiguration;
23  import org.apache.maven.artifact.repository.ArtifactRepository;
24  import org.apache.maven.execution.MavenSession;
25  import org.apache.maven.plugin.AbstractMojo;
26  import org.apache.maven.plugin.MojoExecutionException;
27  import org.apache.maven.plugin.MojoFailureException;
28  import org.apache.maven.plugin.assembly.AssemblerConfigurationSource;
29  import org.apache.maven.plugin.assembly.InvalidAssemblerConfigurationException;
30  import org.apache.maven.plugin.assembly.archive.ArchiveCreationException;
31  import org.apache.maven.plugin.assembly.archive.AssemblyArchiver;
32  import org.apache.maven.plugin.assembly.format.AssemblyFormattingException;
33  import org.apache.maven.plugin.assembly.io.AssemblyReadException;
34  import org.apache.maven.plugin.assembly.io.AssemblyReader;
35  import org.apache.maven.plugin.assembly.model.Assembly;
36  import org.apache.maven.plugin.assembly.utils.AssemblyFormatUtils;
37  import org.apache.maven.plugin.logging.Log;
38  import org.apache.maven.plugins.annotations.Component;
39  import org.apache.maven.plugins.annotations.Parameter;
40  import org.apache.maven.project.MavenProject;
41  import org.apache.maven.project.MavenProjectHelper;
42  import org.apache.maven.shared.filtering.MavenFileFilter;
43  import org.codehaus.plexus.configuration.PlexusConfiguration;
44  
45  import java.io.File;
46  import java.util.Collections;
47  import java.util.Iterator;
48  import java.util.List;
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 1401676 2012-10-24 13:43:25Z dennisl $
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      protected 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      protected 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 one of the following
135      * values in a &lt;format&gt; subelement:
136      * <ul>
137      * <li><em>dir</em> - Creates a directory</li>
138      * <li><em>zip</em> - Creates a ZIP file format</li>
139      * <li><em>tar</em> - Creates a TAR format</li>
140      * <li><em>tar.gz</em> - Creates a gzip'd TAR format</li>
141      * <li><em>tar.bz2</em> - Creates a bzip'd TAR format</li>
142      * </ul>
143      */
144     @Parameter
145     private List<String> formats;
146 
147     /**
148      * This is the artifact classifier to be used for the resultant assembly artifact. Normally, you would use the
149      * assembly-id instead of specifying this here.
150      *
151      * @deprecated Please use the Assembly's id for classifier instead
152      */
153     @Deprecated
154     @SuppressWarnings( "unused" )
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>,
167      * <code>jar-with-dependencies</code>, <code>src</code>, and
168      * <code>project</code>. You can add others by adding dependencies
169      * to the plugin.
170      */
171     @Parameter
172     private String[] descriptorRefs;
173 
174     /**
175      * Directory to scan for descriptor files in. <b>NOTE:</b> This may not work correctly with assembly components.
176      */
177     @Parameter
178     private File descriptorSourceDirectory;
179 
180     /**
181      * This is the base directory from which archive files are created. This base directory pre-pended to any
182      * <code>&lt;directory&gt;</code> specifications in the assembly descriptor. This is an optional parameter.
183      */
184     @Parameter
185     private File archiveBaseDirectory;
186 
187     /**
188      * Predefined Assembly Descriptor Id's. You can select bin, jar-with-dependencies, or src.
189      *
190      * @deprecated Please use descriptorRefs instead
191      */
192     @Deprecated
193     @Parameter( property = "descriptorId" )
194     protected String descriptorId;
195 
196     /**
197      * Assembly XML Descriptor file. This must be the path to your customized descriptor file.
198      *
199      * @deprecated Please use descriptors instead
200      */
201     @Deprecated
202     @Parameter( property = "descriptor" )
203     protected String descriptor;
204 
205     /**
206      * Sets the TarArchiver behavior on file paths with more than 100 characters length. Valid values are: "warn"
207      * (default), "fail", "truncate", "gnu", or "omit".
208      */
209     @Parameter( property = "assembly.tarLongFileMode", defaultValue = "warn" )
210     private String tarLongFileMode;
211 
212     /**
213      * Base directory of the project.
214      */
215     @Parameter( defaultValue = "${project.basedir}", required = true, readonly = true )
216     private File basedir;
217 
218     /**
219      * Maven ProjectHelper.
220      */
221     @Component
222     private MavenProjectHelper projectHelper;
223 
224     /**
225      * Maven shared filtering utility.
226      */
227     @Component
228     private MavenFileFilter mavenFileFilter;
229 
230     /**
231      * The Maven Session Object
232      */
233     @Component
234     private MavenSession mavenSession;
235 
236     /**
237      * Temporary directory that contain the files to be assembled.
238      */
239     @Parameter( defaultValue = "${project.build.directory}/archive-tmp", required = true, readonly = true )
240     private File tempRoot;
241 
242     /**
243      * Directory for site generated.
244      */
245     @Parameter( defaultValue = "${project.reporting.outputDirectory}", readonly = true )
246     private File siteDirectory;
247 
248     /**
249      * Set to true to include the site generated by site:site goal.
250      *
251      * @deprecated Please set this variable in the assembly descriptor instead
252      */
253     @Deprecated
254     @Parameter( property = "includeSite", defaultValue = "false" )
255     private boolean includeSite;
256 
257     /**
258      * Set to false to exclude the assembly id from the assembly final name.
259      */
260     @Parameter( property = "assembly.appendAssemblyId", defaultValue = "true" )
261     protected boolean appendAssemblyId;
262 
263     /**
264      * Set to true in order to not fail when a descriptor is missing.
265      */
266     @Parameter( property = "assembly.ignoreMissingDescriptor", defaultValue = "false" )
267     protected boolean ignoreMissingDescriptor;
268 
269     /**
270      * This is a set of instructions to the archive builder, especially for building .jar files. It enables you to
271      * specify a Manifest file for the jar, in addition to other options.
272      */
273     @Parameter
274     private MavenArchiveConfiguration archive;
275 
276     /**
277      * The list of extra filter properties files to be used along with System properties, project
278      * properties, and filter properties files specified in the POM build/filters section, which
279      * should be used for the filtering during the current mojo execution.
280      * <br/>
281      * Normally, these will be configured from a plugin's execution section, to provide a different
282      * set of filters for a particular execution.
283      */
284     @Parameter
285     protected List<String> filters;
286 
287     /**
288      * Controls whether the assembly plugin tries to attach the resulting assembly to the project.
289      *
290      * @since 2.2-beta-1
291      */
292     @Parameter( property = "assembly.attach", defaultValue = "true" )
293     private boolean attach;
294 
295     /**
296      * Indicates if zip archives (jar,zip etc) being added to the assembly should be compressed again.
297      * Compressing again can result in smaller archive size, but gives noticeably longer execution time.
298      *
299      * @since 2.4
300      */
301     @Parameter( defaultValue = "false" )
302     private boolean recompressZippedFiles;
303 
304     /**
305      */
306     @Component
307     private AssemblyArchiver assemblyArchiver;
308 
309     /**
310      */
311     @Component
312     private AssemblyReader assemblyReader;
313 
314     /**
315      * Allows additional configuration options that are specific to a particular type of archive format. This is
316      * intended to capture an XML configuration that will be used to reflectively setup the options on the archiver
317      * instance. <br/>
318      * For instance, to direct an assembly with the "ear" format to use a particular deployment descriptor, you should
319      * specify the following for the archiverConfig value in your plugin configuration: <br/>
320      * <p/>
321      * <pre>
322      * &lt;appxml&gt;${project.basedir}/somepath/app.xml&lt;/appxml&gt;
323      * </pre>
324      *
325      * @since 2.2-beta-3
326      */
327     @Parameter
328     private PlexusConfiguration archiverConfig;
329 
330     /**
331      * This will cause the assembly to run only at the top of a given module tree. That is, run in the project contained
332      * in the same folder where the mvn execution was launched.
333      *
334      * @since 2.2-beta-4
335      */
336     @Parameter( property = "assembly.runOnlyAtExecutionRoot", defaultValue = "false" )
337     private boolean runOnlyAtExecutionRoot;
338 
339     /**
340      * This will cause the assembly to only update an existing archive, if it exists.
341      * <p>
342      * <strong>Note:</strong> The property that can be used on the command line
343      * was misspelled as "assembly.updatOnly" in versions prior to version 2.4.
344      * </p>
345      *
346      * @since 2.2
347      */
348     @Parameter( property = "assembly.updateOnly", defaultValue = "false" )
349     private boolean updateOnly;
350 
351     /**
352      * <p>
353      * will use the jvm chmod, this is available for user and all level group level will be ignored
354      * </p>
355      *
356      * @since 2.2
357      */
358     @Parameter( property = "assembly.useJvmChmod", defaultValue = "false" )
359     private boolean useJvmChmod;
360 
361     /**
362      * <p>
363      * Set to <code>true</code> in order to avoid all chmod calls.
364      * </p>
365      * <p/>
366      * <p>
367      * <b>NOTE:</b> This will cause the assembly plugin to <b>DISREGARD</b> all fileMode/directoryMode settings in the
368      * assembly descriptor, and all file permissions in unpacked dependencies!
369      * </p>
370      *
371      * @since 2.2
372      */
373     @Parameter( property = "assembly.ignorePermissions", defaultValue = "false" )
374     private boolean ignorePermissions;
375 
376     /**
377      * Create the binary distribution.
378      * 
379      * @throws org.apache.maven.plugin.MojoExecutionException
380      * 
381      */
382     public void execute()
383         throws MojoExecutionException, MojoFailureException
384     {
385         if ( skipAssembly )
386         {
387             getLog().info( "Assemblies have been skipped per configuration of the skipAssembly parameter." );
388             return;
389         }
390 
391         // run only at the execution root.
392         if ( runOnlyAtExecutionRoot && !isThisTheExecutionRoot() )
393         {
394             getLog().info( "Skipping the assembly in this project because it's not the Execution Root" );
395             return;
396         }
397 
398         List<Assembly> assemblies;
399         try
400         {
401             assemblies = assemblyReader.readAssemblies( this );
402         }
403         catch ( final AssemblyReadException e )
404         {
405             throw new MojoExecutionException( "Error reading assemblies: " + e.getMessage(), e );
406         }
407         catch ( final InvalidAssemblerConfigurationException e )
408         {
409             throw new MojoFailureException( assemblyReader, e.getMessage(), "Mojo configuration is invalid: "
410                             + e.getMessage() );
411         }
412 
413         // TODO: include dependencies marked for distribution under certain formats
414         // TODO: how, might we plug this into an installer, such as NSIS?
415 
416         boolean warnedAboutMainProjectArtifact = false;
417         for ( final Iterator<Assembly> assemblyIterator = assemblies.iterator(); assemblyIterator.hasNext(); )
418         {
419             final Assembly assembly = assemblyIterator.next();
420             try
421             {
422                 final String fullName = AssemblyFormatUtils.getDistributionName( assembly, this );
423                 
424                 List<String> effectiveFormats = formats;
425                 if ( effectiveFormats == null || effectiveFormats.size() == 0 )
426                 {
427                     effectiveFormats = assembly.getFormats();
428                 }
429                 if ( effectiveFormats == null || effectiveFormats.size() == 0 ) 
430                 {
431                     throw new MojoFailureException( "No formats specified in the execution parameters or the assembly descriptor.");
432                 }
433 
434                 for ( final String format : effectiveFormats )
435                 {
436                     final File destFile = assemblyArchiver.createArchive( assembly, fullName, format, this, isRecompressZippedFiles());
437 
438                     final MavenProject project = getProject();
439                     final String classifier = getClassifier();
440                     final String type = project.getArtifact()
441                                                .getType();
442 
443                     if ( attach && destFile.isFile() )
444                     {
445                         if ( isAssemblyIdAppended() )
446                         {
447                             projectHelper.attachArtifact( project, format, assembly.getId(), destFile );
448                         }
449                         else if ( classifier != null )
450                         {
451                             projectHelper.attachArtifact( project, format, classifier, destFile );
452                         }
453                         else if ( !"pom".equals( type ) && format.equals( type ) )
454                         {
455                             if ( !warnedAboutMainProjectArtifact )
456                             {
457                                 final StringBuilder message = new StringBuilder();
458 
459                                 message.append( "Configuration options: 'appendAssemblyId' is set to false, and 'classifier' is missing." );
460                                 message.append( "\nInstead of attaching the assembly file: " )
461                                        .append( destFile )
462                                        .append( ", it will become the file for main project artifact." );
463                                 message.append( "\nNOTE: If multiple descriptors or descriptor-formats are provided for this project, the value of this file will be non-deterministic!" );
464 
465                                 getLog().warn( message );
466                                 warnedAboutMainProjectArtifact = true;
467                             }
468 
469                             final File existingFile = project.getArtifact()
470                                                              .getFile();
471                             if ( ( existingFile != null ) && existingFile.exists() )
472                             {
473                                 getLog().warn( "Replacing pre-existing project main-artifact file: " + existingFile
474                                                                + "\nwith assembly file: " + destFile );
475                             }
476 
477                             project.getArtifact()
478                                    .setFile( destFile );
479                         }
480                         else
481                         {
482                             projectHelper.attachArtifact( project, format, null, destFile );
483                         }
484                     }
485                     else if ( attach )
486                     {
487                         getLog().warn( "Assembly file: "
488                                                        + destFile
489                                                        + " is not a regular file (it may be a directory). It cannot be attached to the project build for installation or deployment." );
490                     }
491                 }
492             }
493             catch ( final ArchiveCreationException e )
494             {
495                 throw new MojoExecutionException( "Failed to create assembly: " + e.getMessage(), e );
496             }
497             catch ( final AssemblyFormattingException e )
498             {
499                 throw new MojoExecutionException( "Failed to create assembly: " + e.getMessage(), e );
500             }
501             catch ( final InvalidAssemblerConfigurationException e )
502             {
503                 throw new MojoFailureException( assembly, "Assembly is incorrectly configured: " + assembly.getId(),
504                                                 "Assembly: " + assembly.getId() + " is not configured correctly: "
505                                                                 + e.getMessage() );
506             }
507         }
508     }
509 
510     /**
511      * Returns true if the current project is located at the Execution Root Directory (where mvn was launched)
512      * 
513      * @return
514      */
515     protected boolean isThisTheExecutionRoot()
516     {
517         final Log log = getLog();
518         log.debug( "Root Folder:" + mavenSession.getExecutionRootDirectory() );
519         log.debug( "Current Folder:" + basedir );
520         final boolean result = mavenSession.getExecutionRootDirectory()
521                                            .equalsIgnoreCase( basedir.toString() );
522         if ( result )
523         {
524             log.debug( "This is the execution root." );
525         }
526         else
527         {
528             log.debug( "This is NOT the execution root." );
529         }
530 
531         return result;
532     }
533 
534     protected AssemblyArchiver getAssemblyArchiver()
535     {
536         return assemblyArchiver;
537     }
538 
539     protected AssemblyReader getAssemblyReader()
540     {
541         return assemblyReader;
542     }
543 
544     public File getBasedir()
545     {
546         return basedir;
547     }
548 
549     /**
550      * {@inheritDoc}
551      * 
552      * @deprecated This has been replaced by {@link #getDescriptors()}
553      */
554     @Deprecated
555     public String getDescriptor()
556     {
557         return descriptor;
558     }
559 
560     /**
561      * {@inheritDoc}
562      * 
563      * @deprecated This has been replaced by {@link #getDescriptorReferences()}
564      */
565     @Deprecated
566     public String getDescriptorId()
567     {
568         return descriptorId;
569     }
570 
571     public String[] getDescriptorReferences()
572     {
573         return descriptorRefs;
574     }
575 
576     public File getDescriptorSourceDirectory()
577     {
578         return descriptorSourceDirectory;
579     }
580 
581     public String[] getDescriptors()
582     {
583         return descriptors;
584     }
585 
586     public abstract MavenProject getProject();
587 
588     public File getSiteDirectory()
589     {
590         return siteDirectory;
591     }
592 
593     public boolean isSiteIncluded()
594     {
595         return includeSite;
596     }
597 
598     public String getFinalName()
599     {
600         return finalName;
601     }
602 
603     public boolean isAssemblyIdAppended()
604     {
605         return appendAssemblyId;
606     }
607 
608     public String getTarLongFileMode()
609     {
610         return tarLongFileMode;
611     }
612 
613     public File getOutputDirectory()
614     {
615         return outputDirectory;
616     }
617 
618     public MavenArchiveConfiguration getJarArchiveConfiguration()
619     {
620         return archive;
621     }
622 
623     public File getWorkingDirectory()
624     {
625         return workDirectory;
626     }
627 
628     public ArtifactRepository getLocalRepository()
629     {
630         return localRepository;
631     }
632 
633     public File getTemporaryRootDirectory()
634     {
635         return tempRoot;
636     }
637 
638     public File getArchiveBaseDirectory()
639     {
640         return archiveBaseDirectory;
641     }
642 
643     public List<String> getFilters()
644     {
645         if ( filters == null )
646         {
647             filters = getProject().getBuild()
648                                   .getFilters();
649             if ( filters == null )
650             {
651                 filters = Collections.emptyList();
652             }
653         }
654         return filters;
655     }
656 
657     public List<MavenProject> getReactorProjects()
658     {
659         return reactorProjects;
660     }
661 
662     public String getClassifier()
663     {
664         // TODO Auto-generated method stub
665         return null;
666     }
667 
668     protected MavenProjectHelper getProjectHelper()
669     {
670         return projectHelper;
671     }
672 
673     public void setAppendAssemblyId( final boolean appendAssemblyId )
674     {
675         this.appendAssemblyId = appendAssemblyId;
676     }
677 
678     public void setArchive( final MavenArchiveConfiguration archive )
679     {
680         this.archive = archive;
681     }
682 
683     public void setArchiveBaseDirectory( final File archiveBaseDirectory )
684     {
685         this.archiveBaseDirectory = archiveBaseDirectory;
686     }
687 
688     public void setAssemblyArchiver( final AssemblyArchiver assemblyArchiver )
689     {
690         this.assemblyArchiver = assemblyArchiver;
691     }
692 
693     public void setAssemblyReader( final AssemblyReader assemblyReader )
694     {
695         this.assemblyReader = assemblyReader;
696     }
697 
698     public void setBasedir( final File basedir )
699     {
700         this.basedir = basedir;
701     }
702 
703     public void setClassifier( final String classifier )
704     {
705         this.classifier = classifier;
706     }
707 
708     /**
709      * {@inheritDoc}
710      * 
711      * @deprecated This has been replaced by {@link #setDescriptors(String[])}
712      */
713     @Deprecated
714     public void setDescriptor( final String descriptor )
715     {
716         this.descriptor = descriptor;
717     }
718 
719     /**
720      * {@inheritDoc}
721      * 
722      * @deprecated This has been replaced by {@link #setDescriptorRefs(String[])}
723      */
724     @Deprecated
725     public void setDescriptorId( final String descriptorId )
726     {
727         this.descriptorId = descriptorId;
728     }
729 
730     public void setDescriptorRefs( final String[] descriptorRefs )
731     {
732         this.descriptorRefs = descriptorRefs;
733     }
734 
735     public void setDescriptors( final String[] descriptors )
736     {
737         this.descriptors = descriptors;
738     }
739 
740     public void setDescriptorSourceDirectory( final File descriptorSourceDirectory )
741     {
742         this.descriptorSourceDirectory = descriptorSourceDirectory;
743     }
744 
745     public void setFilters( final List<String> filters )
746     {
747         this.filters = filters;
748     }
749 
750     public void setFinalName( final String finalName )
751     {
752         this.finalName = finalName;
753     }
754 
755     public void setIncludeSite( final boolean includeSite )
756     {
757         this.includeSite = includeSite;
758     }
759 
760     public void setLocalRepository( final ArtifactRepository localRepository )
761     {
762         this.localRepository = localRepository;
763     }
764 
765     public void setOutputDirectory( final File outputDirectory )
766     {
767         this.outputDirectory = outputDirectory;
768     }
769 
770     public void setProjectHelper( final MavenProjectHelper projectHelper )
771     {
772         this.projectHelper = projectHelper;
773     }
774 
775     public void setReactorProjects( final List<MavenProject> reactorProjects )
776     {
777         this.reactorProjects = reactorProjects;
778     }
779 
780     public void setSiteDirectory( final File siteDirectory )
781     {
782         this.siteDirectory = siteDirectory;
783     }
784 
785     public void setTarLongFileMode( final String tarLongFileMode )
786     {
787         this.tarLongFileMode = tarLongFileMode;
788     }
789 
790     public void setTempRoot( final File tempRoot )
791     {
792         this.tempRoot = tempRoot;
793     }
794 
795     public void setWorkDirectory( final File workDirectory )
796     {
797         this.workDirectory = workDirectory;
798     }
799 
800     public List<ArtifactRepository> getRemoteRepositories()
801     {
802         return remoteRepositories;
803     }
804 
805     public boolean isDryRun()
806     {
807         return dryRun;
808     }
809 
810     public boolean isIgnoreDirFormatExtensions()
811     {
812         return ignoreDirFormatExtensions;
813     }
814 
815     public boolean isIgnoreMissingDescriptor()
816     {
817         return ignoreMissingDescriptor;
818     }
819 
820     public void setIgnoreMissingDescriptor( final boolean ignoreMissingDescriptor )
821     {
822         this.ignoreMissingDescriptor = ignoreMissingDescriptor;
823     }
824 
825     public MavenSession getMavenSession()
826     {
827         return mavenSession;
828     }
829 
830     public String getArchiverConfig()
831     {
832         return archiverConfig == null ? null : archiverConfig.toString();
833     }
834 
835     public MavenFileFilter getMavenFileFilter()
836     {
837         return mavenFileFilter;
838     }
839 
840     public boolean isUpdateOnly()
841     {
842         return updateOnly;
843     }
844 
845     public boolean isUseJvmChmod()
846     {
847         return useJvmChmod;
848     }
849 
850     public boolean isIgnorePermissions()
851     {
852         return ignorePermissions;
853     }
854     
855     public String getEncoding() {
856         return encoding;
857     }
858 
859     protected boolean isRecompressZippedFiles() {
860         return recompressZippedFiles;
861     }
862 
863     public String getEscapeString() {
864       return escapeString;
865     }
866 }