001package org.apache.maven.cli; 002 003/* 004 * Licensed to the Apache Software Foundation (ASF) under one 005 * or more contributor license agreements. See the NOTICE file 006 * distributed with this work for additional information 007 * regarding copyright ownership. The ASF licenses this file 008 * to you under the Apache License, Version 2.0 (the 009 * "License"); you may not use this file except in compliance 010 * with the License. You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, 015 * software distributed under the License is distributed on an 016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 017 * KIND, either express or implied. See the License for the 018 * specific language governing permissions and limitations 019 * under the License. 020 */ 021 022import java.io.File; 023import java.util.Properties; 024 025import org.apache.commons.cli.CommandLine; 026import org.apache.maven.execution.DefaultMavenExecutionRequest; 027import org.apache.maven.execution.MavenExecutionRequest; 028import org.codehaus.plexus.classworlds.ClassWorld; 029 030public class CliRequest 031{ 032 String[] args; 033 034 CommandLine commandLine; 035 036 ClassWorld classWorld; 037 038 String workingDirectory; 039 040 File multiModuleProjectDirectory; 041 042 boolean debug; 043 044 boolean quiet; 045 046 boolean showErrors = true; 047 048 Properties userProperties = new Properties(); 049 050 Properties systemProperties = new Properties(); 051 052 MavenExecutionRequest request; 053 054 CliRequest( String[] args, ClassWorld classWorld ) 055 { 056 this.args = args; 057 this.classWorld = classWorld; 058 this.request = new DefaultMavenExecutionRequest(); 059 } 060 061 public String[] getArgs() 062 { 063 return args; 064 } 065 066 public CommandLine getCommandLine() 067 { 068 return commandLine; 069 } 070 071 public ClassWorld getClassWorld() 072 { 073 return classWorld; 074 } 075 076 public String getWorkingDirectory() 077 { 078 return workingDirectory; 079 } 080 081 public File getMultiModuleProjectDirectory() 082 { 083 return multiModuleProjectDirectory; 084 } 085 086 public boolean isDebug() 087 { 088 return debug; 089 } 090 091 public boolean isQuiet() 092 { 093 return quiet; 094 } 095 096 public boolean isShowErrors() 097 { 098 return showErrors; 099 } 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}