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