View Javadoc

1   package org.apache.maven.settings.building;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.io.File;
23  import java.util.Properties;
24  
25  /**
26   * Collects settings that control the building of effective settings.
27   * 
28   * @author Benjamin Bentmann
29   */
30  public interface SettingsBuildingRequest
31  {
32  
33      /**
34       * Gets the global settings file.
35       * 
36       * @return The global settings file or {@code null} if none.
37       */
38      File getGlobalSettingsFile();
39  
40      /**
41       * Sets the global settings file. A non-existent settings file is equivalent to empty settings. If both a user
42       * settings file and a global settings file are given, the user settings take precedence.
43       * 
44       * @param globalSettingsFile The global settings file, may be {@code null} to disable global settings.
45       * @return This request, never {@code null}.
46       */
47      SettingsBuildingRequest setGlobalSettingsFile( File globalSettingsFile );
48  
49      /**
50       * Gets the user settings file.
51       * 
52       * @return The user settings file or {@code null} if none.
53       */
54      File getUserSettingsFile();
55  
56      /**
57       * Sets the user settings file. A non-existent settings file is equivalent to empty settings. If both a user
58       * settings file and a global settings file are given, the user settings take precedence.
59       * 
60       * @param userSettingsFile The user settings file, may be {@code null} to disable user settings.
61       * @return This request, never {@code null}.
62       */
63      SettingsBuildingRequest setUserSettingsFile( File userSettingsFile );
64  
65      /**
66       * Gets the system properties to use for interpolation. The system properties are collected from the runtime
67       * environment like {@link System#getProperties()} and environment variables.
68       * 
69       * @return The system properties, never {@code null}.
70       */
71      Properties getSystemProperties();
72  
73      /**
74       * Sets the system properties to use for interpolation. The system properties are collected from the runtime
75       * environment like {@link System#getProperties()} and environment variables.
76       * 
77       * @param systemProperties The system properties, may be {@code null}.
78       * @return This request, never {@code null}.
79       */
80      SettingsBuildingRequest setSystemProperties( Properties systemProperties );
81  
82      /**
83       * Gets the user properties to use for interpolation. The user properties have been configured directly by the user
84       * on his discretion, e.g. via the {@code -Dkey=value} parameter on the command line.
85       * 
86       * @return The user properties, never {@code null}.
87       */
88      Properties getUserProperties();
89  
90      /**
91       * Sets the user properties to use for interpolation. The user properties have been configured directly by the user
92       * on his discretion, e.g. via the {@code -Dkey=value} parameter on the command line.
93       * 
94       * @param userProperties The user properties, may be {@code null}.
95       * @return This request, never {@code null}.
96       */
97      SettingsBuildingRequest setUserProperties( Properties userProperties );
98  
99  }