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