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