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