KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > maven > execution > DefaultMavenExecutionRequest


1 package org.apache.maven.execution;
2
3 /*
4  * Copyright 2001-2005 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 import org.apache.maven.artifact.repository.ArtifactRepository;
20 import org.apache.maven.monitor.event.EventDispatcher;
21 import org.apache.maven.monitor.event.EventMonitor;
22 import org.apache.maven.profiles.ProfileManager;
23 import org.apache.maven.settings.Settings;
24
25 import java.util.Date JavaDoc;
26 import java.util.List JavaDoc;
27 import java.util.Properties JavaDoc;
28
29 /**
30  * @author <a HREF="mailto:jason@maven.org">Jason van Zyl</a>
31  * @version $Id: DefaultMavenExecutionRequest.java 320797 2005-10-13 16:36:54Z brett $
32  */

33 public class DefaultMavenExecutionRequest
34     implements MavenExecutionRequest
35 {
36     /**
37      * @todo [BP] is this required? This hands off to MavenSession, but could be passed through the handler.handle function (+ createSession).
38      */

39     private final ArtifactRepository localRepository;
40
41     private final List JavaDoc goals;
42
43     protected MavenSession session;
44
45     private final EventDispatcher eventDispatcher;
46
47     private final Settings settings;
48
49     private final String JavaDoc baseDirectory;
50
51     private boolean recursive = true;
52
53     private boolean reactorActive;
54
55     private String JavaDoc pomFilename;
56
57     private String JavaDoc failureBehavior;
58
59     private final ProfileManager globalProfileManager;
60
61     private final Properties JavaDoc executionProperties;
62
63     private final Date JavaDoc startTime;
64
65     private final boolean showErrors;
66
67     public DefaultMavenExecutionRequest( ArtifactRepository localRepository, Settings settings,
68                                          EventDispatcher eventDispatcher, List JavaDoc goals, String JavaDoc baseDirectory,
69                                          ProfileManager globalProfileManager, Properties JavaDoc executionProperties,
70                                          boolean showErrors )
71     {
72         this.localRepository = localRepository;
73
74         this.settings = settings;
75
76         this.goals = goals;
77
78         this.eventDispatcher = eventDispatcher;
79
80         this.baseDirectory = baseDirectory;
81
82         this.globalProfileManager = globalProfileManager;
83
84         this.executionProperties = executionProperties;
85
86         this.startTime = new Date JavaDoc();
87
88         this.showErrors = showErrors;
89     }
90
91     public Settings getSettings()
92     {
93         return settings;
94     }
95
96     public String JavaDoc getBaseDirectory()
97     {
98         return baseDirectory;
99     }
100
101     public boolean isRecursive()
102     {
103         return recursive;
104     }
105
106     public void setRecursive( boolean recursive )
107     {
108         this.recursive = false;
109     }
110
111     public ArtifactRepository getLocalRepository()
112     {
113         return localRepository;
114     }
115
116     public List JavaDoc getGoals()
117     {
118         return goals;
119     }
120
121     public Properties JavaDoc getExecutionProperties()
122     {
123         return executionProperties;
124     }
125
126     // ----------------------------------------------------------------------
127
// Putting the session here but it can probably be folded right in here.
128
// ----------------------------------------------------------------------
129

130     public MavenSession getSession()
131     {
132         return session;
133     }
134
135     public void setSession( MavenSession session )
136     {
137         this.session = session;
138     }
139
140     public void addEventMonitor( EventMonitor monitor )
141     {
142         eventDispatcher.addEventMonitor( monitor );
143     }
144
145     public EventDispatcher getEventDispatcher()
146     {
147         return eventDispatcher;
148     }
149
150     public void setReactorActive( boolean reactorActive )
151     {
152         this.reactorActive = reactorActive;
153     }
154
155     public boolean isReactorActive()
156     {
157         return reactorActive;
158     }
159
160     public void setPomFile( String JavaDoc pomFilename )
161     {
162         this.pomFilename = pomFilename;
163     }
164
165     public String JavaDoc getPomFile()
166     {
167         return pomFilename;
168     }
169
170     public void setFailureBehavior( String JavaDoc failureBehavior )
171     {
172         this.failureBehavior = failureBehavior;
173     }
174
175     public String JavaDoc getFailureBehavior()
176     {
177         return failureBehavior;
178     }
179
180     public ProfileManager getGlobalProfileManager()
181     {
182         return globalProfileManager;
183     }
184
185     public Date JavaDoc getStartTime()
186     {
187         return startTime;
188     }
189
190     public boolean isShowErrors()
191     {
192         return showErrors;
193     }
194 }
195
Popular Tags