View Javadoc
1   package org.apache.maven.model.profile;
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.List;
24  import java.util.Map;
25  
26  /**
27   * Describes the environmental context used to determine the activation status of profiles.
28   * 
29   * @author Benjamin Bentmann
30   */
31  public interface ProfileActivationContext
32  {
33  
34      /**
35       * Gets the identifiers of those profiles that should be activated by explicit demand.
36       * 
37       * @return The identifiers of those profiles to activate, never {@code null}.
38       */
39      List<String> getActiveProfileIds();
40  
41      /**
42       * Gets the identifiers of those profiles that should be deactivated by explicit demand.
43       * 
44       * @return The identifiers of those profiles to deactivate, never {@code null}.
45       */
46      List<String> getInactiveProfileIds();
47  
48      /**
49       * Gets the system properties to use for interpolation and profile activation. The system properties are collected
50       * from the runtime environment like {@link System#getProperties()} and environment variables.
51       * 
52       * @return The execution properties, never {@code null}.
53       */
54      Map<String, String> getSystemProperties();
55  
56      /**
57       * Gets the user properties to use for interpolation and profile activation. The user properties have been
58       * configured directly by the user on his discretion, e.g. via the {@code -Dkey=value} parameter on the command
59       * line.
60       * 
61       * @return The user properties, never {@code null}.
62       */
63      Map<String, String> getUserProperties();
64  
65      /**
66       * Gets the base directory of the current project (if any).
67       * 
68       * @return The base directory of the current project or {@code null} if none.
69       */
70      File getProjectDirectory();
71  
72      /**
73       * Gets current calculated project properties
74       *
75       * @return The project properties, never {@code null}.
76       */
77      Map<String, String> getProjectProperties();
78  
79  }