View Javadoc
1   package org.apache.maven.archetype.common;
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.UnknownArchetype;
23  import org.apache.maven.archetype.metadata.ArchetypeDescriptor;
24  import org.apache.maven.artifact.repository.ArtifactRepository;
25  import org.apache.maven.model.Model;
26  
27  import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
28  
29  import java.io.File;
30  import java.io.IOException;
31  
32  import java.util.List;
33  import java.util.zip.ZipFile;
34  
35  public interface ArchetypeArtifactManager
36  {
37      String ROLE = ArchetypeArtifactManager.class.getName ();
38  
39      Model getArchetypePom ( File jar )
40          throws XmlPullParserException, UnknownArchetype, IOException;
41  
42      /**
43       */
44      File getArchetypeFile( String groupId, String artifactId, String version,
45                             ArtifactRepository archetypeRepository, ArtifactRepository localRepository,
46                             List<ArtifactRepository> repositories )
47          throws UnknownArchetype;
48  
49      /**
50       */
51      ClassLoader getArchetypeJarLoader( File archetypeFile )
52          throws UnknownArchetype;
53  
54      /**
55       */
56      ZipFile getArchetypeZipFile( File archetypeFile )
57          throws UnknownArchetype;
58  
59      /**
60       */
61      boolean isFileSetArchetype( File archetypeFile );
62  
63      /**
64       */
65      boolean isFileSetArchetype( String groupId, String artifactId, String version,
66                                  ArtifactRepository archetypeRepository, ArtifactRepository localRepository,
67                                  List<ArtifactRepository> repositories );
68  
69      /**
70       */
71      boolean isOldArchetype( File archetypeFile );
72  
73      /**
74       */
75      boolean isOldArchetype( String groupId, String artifactId, String version, ArtifactRepository archetypeRepository,
76                              ArtifactRepository localRepository, List<ArtifactRepository> repositories );
77  
78      /**
79       */
80      boolean exists( String archetypeGroupId, String archetypeArtifactId, String archetypeVersion,
81                      ArtifactRepository archetypeRepository, ArtifactRepository localRepository,
82                      List<ArtifactRepository> repos );
83  
84      /**
85       */
86      ArchetypeDescriptor getFileSetArchetypeDescriptor( File archetypeFile )
87          throws UnknownArchetype;
88  
89      /**
90       */
91      ArchetypeDescriptor getFileSetArchetypeDescriptor( String groupId, String artifactId, String version,
92                                                         ArtifactRepository archetypeRepository,
93                                                         ArtifactRepository localRepository,
94                                                         List<ArtifactRepository> repositories )
95          throws UnknownArchetype;
96  
97      /**
98       */
99      List<String> getFilesetArchetypeResources( File archetypeFile )
100         throws UnknownArchetype;
101 
102     /**
103      */
104     org.apache.maven.archetype.old.descriptor.ArchetypeDescriptor getOldArchetypeDescriptor( File archetypeFile )
105         throws UnknownArchetype;
106 
107     /**
108      */
109     org.apache.maven.archetype.old.descriptor.ArchetypeDescriptor getOldArchetypeDescriptor(
110             String groupId, String artifactId, String version, ArtifactRepository archetypeRepository,
111             ArtifactRepository localRepository, List<ArtifactRepository> repositories )
112         throws UnknownArchetype;
113 }