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.settings.building; 20 21 import java.io.File; 22 import java.util.Properties; 23 24 /** 25 * Collects settings that control the building of effective settings. 26 * 27 * @author Benjamin Bentmann 28 */ 29 public interface SettingsBuildingRequest { 30 31 /** 32 * Gets the global settings file. 33 * 34 * @return The global settings file or {@code null} if none. 35 */ 36 File getGlobalSettingsFile(); 37 38 /** 39 * Sets the global settings file. A non-existent settings file is equivalent to empty settings. If both user 40 * settings and global settings are given, the user settings take precedence. 41 * 42 * @param globalSettingsFile The global settings file, may be {@code null} to disable global settings. 43 * @return This request, never {@code null}. 44 */ 45 SettingsBuildingRequest setGlobalSettingsFile(File globalSettingsFile); 46 47 /** 48 * Gets the global settings source. 49 * 50 * @return The global settings source or {@code null} if none. 51 */ 52 SettingsSource getGlobalSettingsSource(); 53 54 /** 55 * Sets the global settings source. If both user settings and a global settings are given, the user settings take 56 * precedence. 57 * 58 * @param globalSettingsSource The global settings source, may be {@code null} to disable global settings. 59 * @return This request, never {@code null}. 60 */ 61 SettingsBuildingRequest setGlobalSettingsSource(SettingsSource globalSettingsSource); 62 63 /** 64 * Gets the user settings file. 65 * 66 * @return The user settings file or {@code null} if none. 67 */ 68 File getUserSettingsFile(); 69 70 /** 71 * Sets the user settings file. A non-existent settings file is equivalent to empty settings. If both a user 72 * settings file and a global settings file are given, the user settings take precedence. 73 * 74 * @param userSettingsFile The user settings file, may be {@code null} to disable user settings. 75 * @return This request, never {@code null}. 76 */ 77 SettingsBuildingRequest setUserSettingsFile(File userSettingsFile); 78 79 /** 80 * Gets the user settings source. 81 * 82 * @return The user settings source or {@code null} if none. 83 */ 84 SettingsSource getUserSettingsSource(); 85 86 /** 87 * Sets the user settings source. If both user settings and a global settings are given, the user settings take 88 * precedence. 89 * 90 * @param userSettingsSource The user settings source, may be {@code null} to disable user settings. 91 * @return This request, never {@code null}. 92 */ 93 SettingsBuildingRequest setUserSettingsSource(SettingsSource userSettingsSource); 94 95 /** 96 * Gets the system properties to use for interpolation. The system properties are collected from the runtime 97 * environment like {@link System#getProperties()} and environment variables. 98 * 99 * @return The system properties, never {@code null}. 100 */ 101 Properties getSystemProperties(); 102 103 /** 104 * Sets the system properties to use for interpolation. The system properties are collected from the runtime 105 * environment like {@link System#getProperties()} and environment variables. 106 * 107 * @param systemProperties The system properties, may be {@code null}. 108 * @return This request, never {@code null}. 109 */ 110 SettingsBuildingRequest setSystemProperties(Properties systemProperties); 111 112 /** 113 * Gets the user properties to use for interpolation. The user properties have been configured directly by the user 114 * on his discretion, e.g. via the {@code -Dkey=value} parameter on the command line. 115 * 116 * @return The user properties, never {@code null}. 117 */ 118 Properties getUserProperties(); 119 120 /** 121 * Sets the user properties to use for interpolation. The user properties have been configured directly by the user 122 * on his discretion, e.g. via the {@code -Dkey=value} parameter on the command line. 123 * 124 * @param userProperties The user properties, may be {@code null}. 125 * @return This request, never {@code null}. 126 */ 127 SettingsBuildingRequest setUserProperties(Properties userProperties); 128 }