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.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   * @deprecated since 4.0.0, use {@link org.apache.maven.api.services.SettingsBuilder} instead
28   */
29  @Deprecated(since = "4.0.0")
30  public interface SettingsBuildingRequest {
31  
32      /**
33       * Gets the global settings file.
34       *
35       * @return The global settings file or {@code null} if none.
36       */
37      File getGlobalSettingsFile();
38  
39      /**
40       * Sets the global settings file. A non-existent settings file is equivalent to empty settings. If both user
41       * settings and global settings are given, the user settings take precedence.
42       *
43       * @param globalSettingsFile The global settings file, may be {@code null} to disable global settings.
44       * @return This request, never {@code null}.
45       */
46      SettingsBuildingRequest setGlobalSettingsFile(File globalSettingsFile);
47  
48      /**
49       * Gets the global settings source.
50       *
51       * @return The global settings source or {@code null} if none.
52       */
53      SettingsSource getGlobalSettingsSource();
54  
55      /**
56       * Sets the global settings source. If both user settings and a global settings are given, the user settings take
57       * precedence.
58       *
59       * @param globalSettingsSource The global settings source, may be {@code null} to disable global settings.
60       * @return This request, never {@code null}.
61       */
62      SettingsBuildingRequest setGlobalSettingsSource(SettingsSource globalSettingsSource);
63  
64      /**
65       * Gets the project settings file.
66       *
67       * @return The project settings file or {@code null} if none.
68       * @since 4.0.0
69       */
70      File getProjectSettingsFile();
71  
72      /**
73       * Sets the project settings file. A non-existent settings file is equivalent to empty settings.
74       *
75       * @param projectSettingsFile The project settings file, may be {@code null} to disable project settings.
76       * @return This request, never {@code null}.
77       * @since 4.0.0
78       */
79      DefaultSettingsBuildingRequest setProjectSettingsFile(File projectSettingsFile);
80  
81      /**
82       * Gets the project settings source.
83       *
84       * @return The project settings source or {@code null} if none.
85       * @since 4.0.0
86       */
87      SettingsSource getProjectSettingsSource();
88  
89      /**
90       * Sets the project settings source.
91       *
92       * @param projectSettingsSource The project settings source, may be {@code null} to disable global settings.
93       * @return This request, never {@code null}.
94       * @since 4.0.0
95       */
96      SettingsBuildingRequest setProjectSettingsSource(SettingsSource projectSettingsSource);
97  
98      /**
99       * Gets the user settings file.
100      *
101      * @return The user settings file or {@code null} if none.
102      */
103     File getUserSettingsFile();
104 
105     /**
106      * Sets the user settings file. A non-existent settings file is equivalent to empty settings. If both a user
107      * settings file and a global settings file are given, the user settings take precedence.
108      *
109      * @param userSettingsFile The user settings file, may be {@code null} to disable user settings.
110      * @return This request, never {@code null}.
111      */
112     SettingsBuildingRequest setUserSettingsFile(File userSettingsFile);
113 
114     /**
115      * Gets the user settings source.
116      *
117      * @return The user settings source or {@code null} if none.
118      */
119     SettingsSource getUserSettingsSource();
120 
121     /**
122      * Sets the user settings source. If both user settings and a global settings are given, the user settings take
123      * precedence.
124      *
125      * @param userSettingsSource The user settings source, may be {@code null} to disable user settings.
126      * @return This request, never {@code null}.
127      */
128     SettingsBuildingRequest setUserSettingsSource(SettingsSource userSettingsSource);
129 
130     /**
131      * Gets the system properties to use for interpolation. The system properties are collected from the runtime
132      * environment like {@link System#getProperties()} and environment variables.
133      *
134      * @return The system properties, never {@code null}.
135      */
136     Properties getSystemProperties();
137 
138     /**
139      * Sets the system properties to use for interpolation. The system properties are collected from the runtime
140      * environment like {@link System#getProperties()} and environment variables.
141      *
142      * @param systemProperties The system properties, may be {@code null}.
143      * @return This request, never {@code null}.
144      */
145     SettingsBuildingRequest setSystemProperties(Properties systemProperties);
146 
147     /**
148      * Gets the user properties to use for interpolation. The user properties have been configured directly by the user
149      * on his discretion, e.g. via the {@code -Dkey=value} parameter on the command line.
150      *
151      * @return The user properties, never {@code null}.
152      */
153     Properties getUserProperties();
154 
155     /**
156      * Sets the user properties to use for interpolation. The user properties have been configured directly by the user
157      * on his discretion, e.g. via the {@code -Dkey=value} parameter on the command line.
158      *
159      * @param userProperties The user properties, may be {@code null}.
160      * @return This request, never {@code null}.
161      */
162     SettingsBuildingRequest setUserProperties(Properties userProperties);
163 }