1 package org.apache.maven.lifecycle;
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 java.util.List;
23 import java.util.Map;
24
25 import org.apache.maven.lifecycle.mapping.LifecyclePhase;
26
27 /**
28 * Class Lifecycle.
29 */
30 public class Lifecycle
31 {
32 public Lifecycle()
33 {
34 }
35
36 public Lifecycle( String id, List<String> phases, Map<String, LifecyclePhase> defaultPhases )
37 {
38 this.id = id;
39 this.phases = phases;
40 this.defaultPhases = defaultPhases;
41 }
42
43 // <lifecycle>
44 // <id>clean</id>
45 // <phases>
46 // <phase>pre-clean</phase>
47 // <phase>clean</phase>
48 // <phase>post-clean</phase>
49 // </phases>
50 // <default-phases>
51 // <clean>org.apache.maven.plugins:maven-clean-plugin:clean</clean>
52 // </default-phases>
53 // </lifecycle>
54
55 private String id;
56
57 private List<String> phases;
58
59 private Map<String, LifecyclePhase> defaultPhases;
60
61 public String getId()
62 {
63 return this.id;
64 }
65
66 public List<String> getPhases()
67 {
68 return this.phases;
69 }
70
71 public Map<String, LifecyclePhase> getDefaultLifecyclePhases()
72 {
73 return defaultPhases;
74 }
75
76 @Deprecated
77 public Map<String, String> getDefaultPhases()
78 {
79 return LifecyclePhase.toLegacyMap( getDefaultLifecyclePhases() );
80 }
81
82 @Override
83 public String toString()
84 {
85 return id + " -> " + phases;
86 }
87
88 }