Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
Archetype |
|
| 1.0;1 | ||||
Archetype$1 |
|
| 1.0;1 |
1 | package org.apache.maven.archetype; | |
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.DependencyResolutionRequiredException; | |
23 | ||
24 | import java.io.File; | |
25 | import java.io.IOException; | |
26 | import org.apache.maven.archetype.catalog.ArchetypeCatalog; | |
27 | ||
28 | /** @author Jason van Zyl */ | |
29 | public interface Archetype | |
30 | { | |
31 | 1 | String ROLE = Archetype.class.getName(); |
32 | ||
33 | /** | |
34 | * A command to create an OldArchetype from an existing Maven project given the suppled | |
35 | * creation request. | |
36 | * | |
37 | * @param request | |
38 | * @return The result of creating the archetype from the existing project. It contains any errors that might have occured. | |
39 | */ | |
40 | ArchetypeCreationResult createArchetypeFromProject( ArchetypeCreationRequest request ); | |
41 | ||
42 | /** | |
43 | * A command to generate a Maven project from an OldArchetype given the suppled | |
44 | * generation request. | |
45 | * | |
46 | * @param request | |
47 | * @return The result of creating the proejct from the existing archetype. It contains any errors that might have occured. | |
48 | */ | |
49 | ArchetypeGenerationResult generateProjectFromArchetype( ArchetypeGenerationRequest request ); | |
50 | ||
51 | /** | |
52 | * Gives the catalog of archetypes internal to the plugin. | |
53 | * @return the catalog. | |
54 | */ | |
55 | ArchetypeCatalog getInternalCatalog(); | |
56 | ||
57 | /** | |
58 | * Gives the catalog of archetypes located in $user.home/.m2/repository/archetype-catalog.xml. | |
59 | * @return the catalog. | |
60 | */ | |
61 | ArchetypeCatalog getDefaultLocalCatalog(); | |
62 | ||
63 | /** | |
64 | * Gives the catalog of archetypes located in the given path. | |
65 | * if path is a file, it used as is. | |
66 | * if path is a directory, archetype-catalog.xml is appended to it. | |
67 | * @param path the catalog file path or directory containing the catalog file. | |
68 | * @return the catalog. | |
69 | */ | |
70 | ArchetypeCatalog getLocalCatalog( String path ); | |
71 | ||
72 | /** | |
73 | * Gives the catalog of archetypes located at http://repo1.maven.org/maven2/archetype-catalog.xml. | |
74 | * @return the catalog. | |
75 | */ | |
76 | ArchetypeCatalog getRemoteCatalog(); | |
77 | ||
78 | /** | |
79 | * Gives the catalog of archetypes located at the given url. | |
80 | * if the url doesn't define a catalog, then 'archetype-catalog.xml' is appended to it for search. | |
81 | * @param url the catalog url or base url containing the catalog file. | |
82 | * @return the catalog. | |
83 | */ | |
84 | ArchetypeCatalog getRemoteCatalog( String url ); | |
85 | ||
86 | /** | |
87 | * Creates a jar file for an archetype. | |
88 | * | |
89 | * @param archetypeDirectory | |
90 | * @param outputDirectory | |
91 | * @param finalName | |
92 | * @return The File to the generated jar | |
93 | * @throws org.apache.maven.artifact.DependencyResolutionRequiredException | |
94 | * | |
95 | * @throws java.io.IOException | |
96 | */ | |
97 | File archiveArchetype( File archetypeDirectory, File outputDirectory, String finalName ) | |
98 | throws DependencyResolutionRequiredException, IOException; | |
99 | ||
100 | void updateLocalCatalog( org.apache.maven.archetype.catalog.Archetype archetype, String path ); | |
101 | ||
102 | void updateLocalCatalog( org.apache.maven.archetype.catalog.Archetype archetype ); | |
103 | } |