View Javadoc
1   package org.apache.maven.cli;
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.io.File;
23  import java.util.Properties;
24  
25  import org.apache.commons.cli.CommandLine;
26  import org.apache.maven.execution.DefaultMavenExecutionRequest;
27  import org.apache.maven.execution.MavenExecutionRequest;
28  import org.codehaus.plexus.classworlds.ClassWorld;
29  
30  public class CliRequest
31  {
32      String[] args;
33  
34      CommandLine commandLine;
35  
36      ClassWorld classWorld;
37  
38      String workingDirectory;
39  
40      File multiModuleProjectDirectory;
41  
42      boolean debug;
43  
44      boolean quiet;
45  
46      boolean showErrors = true;
47  
48      Properties userProperties = new Properties();
49  
50      Properties systemProperties = new Properties();
51  
52      MavenExecutionRequest request;
53  
54      CliRequest( String[] args, ClassWorld classWorld )
55      {
56          this.args = args;
57          this.classWorld = classWorld;
58          this.request = new DefaultMavenExecutionRequest();
59      }
60  
61      public String[] getArgs()
62      {
63          return args;
64      }
65  
66      public CommandLine getCommandLine()
67      {
68          return commandLine;
69      }
70  
71      public ClassWorld getClassWorld()
72      {
73          return classWorld;
74      }
75  
76      public String getWorkingDirectory()
77      {
78          return workingDirectory;
79      }
80  
81      public File getMultiModuleProjectDirectory()
82      {
83          return multiModuleProjectDirectory;
84      }
85  
86      public boolean isDebug()
87      {
88          return debug;
89      }
90  
91      public boolean isQuiet()
92      {
93          return quiet;
94      }
95  
96      public boolean isShowErrors()
97      {
98          return showErrors;
99      }
100 
101     public Properties getUserProperties()
102     {
103         return userProperties;
104     }
105 
106     public Properties getSystemProperties()
107     {
108         return systemProperties;
109     }
110 
111     public MavenExecutionRequest getRequest()
112     {
113         return request;
114     }
115 
116     public void setUserProperties( Properties properties ) 
117     {
118         this.userProperties.putAll( properties );      
119     }
120 }