View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  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,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.cli;
20  
21  import java.io.File;
22  import java.util.Properties;
23  
24  import org.apache.commons.cli.CommandLine;
25  import org.apache.maven.execution.DefaultMavenExecutionRequest;
26  import org.apache.maven.execution.MavenExecutionRequest;
27  import org.codehaus.plexus.classworlds.ClassWorld;
28  
29  /**
30   * CliRequest
31   */
32  public class CliRequest {
33      String[] args;
34  
35      CommandLine commandLine;
36  
37      ClassWorld classWorld;
38  
39      String workingDirectory;
40  
41      File multiModuleProjectDirectory;
42  
43      boolean debug;
44  
45      boolean quiet;
46  
47      boolean showErrors = true;
48  
49      Properties userProperties = new Properties();
50  
51      Properties systemProperties = new Properties();
52  
53      MavenExecutionRequest request;
54  
55      CliRequest(String[] args, ClassWorld classWorld) {
56          this.args = args;
57          this.classWorld = classWorld;
58          this.request = new DefaultMavenExecutionRequest();
59      }
60  
61      public String[] getArgs() {
62          return args;
63      }
64  
65      public CommandLine getCommandLine() {
66          return commandLine;
67      }
68  
69      public ClassWorld getClassWorld() {
70          return classWorld;
71      }
72  
73      public String getWorkingDirectory() {
74          return workingDirectory;
75      }
76  
77      public File getMultiModuleProjectDirectory() {
78          return multiModuleProjectDirectory;
79      }
80  
81      public boolean isDebug() {
82          return debug;
83      }
84  
85      public boolean isQuiet() {
86          return quiet;
87      }
88  
89      public boolean isShowErrors() {
90          return showErrors;
91      }
92  
93      public Properties getUserProperties() {
94          return userProperties;
95      }
96  
97      public Properties getSystemProperties() {
98          return systemProperties;
99      }
100 
101     public MavenExecutionRequest getRequest() {
102         return request;
103     }
104 
105     public void setUserProperties(Properties properties) {
106         this.userProperties.putAll(properties);
107     }
108 }