View Javadoc
1   package org.apache.maven.archetype.old;
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.archetype.exception.InvalidPackaging;
23  import org.apache.maven.artifact.repository.ArtifactRepository;
24  
25  import java.io.File;
26  
27  import org.apache.maven.archetype.ArchetypeGenerationRequest;
28  import org.apache.maven.archetype.exception.UnknownArchetype;
29  
30  /**
31   * Create a Maven project from an old archetype.
32   *
33   * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
34   * @version $Id$
35   */
36  public interface OldArchetype
37  {
38      String ROLE = OldArchetype.class.getName();
39  
40      String ARCHETYPE_DESCRIPTOR = "META-INF/maven/archetype.xml";
41  
42      String ARCHETYPE_OLD_DESCRIPTOR = "META-INF/archetype.xml";
43  
44      String ARCHETYPE_RESOURCES = "archetype-resources";
45  
46      // TODO: delete this, it probably should be project.getFile instead
47      String ARCHETYPE_POM = "pom.xml";
48  
49      /**
50       * Download an archetype then create a project from it.
51       */
52      void createArchetype( ArchetypeGenerationRequest request, ArtifactRepository archetypeRepository )
53              throws UnknownArchetype, ArchetypeNotFoundException, ArchetypeDescriptorException,
54              ArchetypeTemplateProcessingException, InvalidPackaging;
55  
56      /**
57       * Create a project from an archetype file.
58       */
59      void createArchetype( ArchetypeGenerationRequest request, File archetypeFile )
60              throws ArchetypeDescriptorException, ArchetypeTemplateProcessingException, InvalidPackaging;
61  }