View Javadoc
1   package org.apache.maven.plugin.assembly.archive;
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.plugin.assembly.AssemblerConfigurationSource;
23  import org.apache.maven.plugin.assembly.InvalidAssemblerConfigurationException;
24  import org.apache.maven.plugin.assembly.format.AssemblyFormattingException;
25  import org.apache.maven.plugin.assembly.model.Assembly;
26  
27  import java.io.File;
28  
29  /**
30   * @version $Id: AssemblyArchiver.java 1639422 2014-11-13 18:08:07Z krosenvold $
31   */
32  public interface AssemblyArchiver
33  {
34      String ROLE = AssemblyArchiver.class.getName();
35  
36      /**
37       * Create the assembly archive. Generally:
38       * <ol>
39       * <li>Setup any directory structures for temporary files</li>
40       * <li>Calculate the output directory/file for the assembly</li>
41       * <li>Setup any handler components for special descriptor files we may encounter</li>
42       * <li>Lookup and configure the {@link org.codehaus.plexus.archiver.Archiver} to be used</li>
43       * <li>Determine what, if any, dependency resolution will be required, and resolve any dependency-version conflicts
44       * up front to produce a managed-version map for the whole assembly process.</li>
45       * <li>Iterate through the available {@link org.apache.maven.plugin.assembly.archive.phase.AssemblyArchiverPhase}
46       * instances, executing each to handle a different
47       * top-level section of the assembly descriptor, if that section is present.</li>
48       * </ol>
49       *
50       * @param assembly              The {@link Assembly}
51       * @param fullName              The full name.
52       * @param format                The format.
53       * @param configSource          The {@link AssemblerConfigurationSource}
54       * @param recompressZippedFiles recompress zipped files.
55       * @return The resulting archive file.
56       * @throws ArchiveCreationException               when creation fails
57       * @throws AssemblyFormattingException            when formatting fails
58       * @throws InvalidAssemblerConfigurationException when the configurationis bad
59       */
60      File createArchive( Assembly assembly, String fullName, String format, AssemblerConfigurationSource configSource,
61                          boolean recompressZippedFiles )
62          throws ArchiveCreationException, AssemblyFormattingException, InvalidAssemblerConfigurationException;
63  }