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