001 package org.apache.maven.model.profile; 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 022 import java.io.File; 023 import java.util.List; 024 import java.util.Map; 025 026 /** 027 * Describes the environmental context used to determine the activation status of profiles. 028 * 029 * @author Benjamin Bentmann 030 */ 031 public interface ProfileActivationContext 032 { 033 034 /** 035 * Gets the identifiers of those profiles that should be activated by explicit demand. 036 * 037 * @return The identifiers of those profiles to activate, never {@code null}. 038 */ 039 List<String> getActiveProfileIds(); 040 041 /** 042 * Gets the identifiers of those profiles that should be deactivated by explicit demand. 043 * 044 * @return The identifiers of those profiles to deactivate, never {@code null}. 045 */ 046 List<String> getInactiveProfileIds(); 047 048 /** 049 * Gets the system properties to use for interpolation and profile activation. The system properties are collected 050 * from the runtime environment like {@link System#getProperties()} and environment variables. 051 * 052 * @return The execution properties, never {@code null}. 053 */ 054 Map<String, String> getSystemProperties(); 055 056 /** 057 * Gets the user properties to use for interpolation and profile activation. The user properties have been 058 * configured directly by the user on his discretion, e.g. via the {@code -Dkey=value} parameter on the command 059 * line. 060 * 061 * @return The user properties, never {@code null}. 062 */ 063 Map<String, String> getUserProperties(); 064 065 /** 066 * Gets the base directory of the current project (if any). 067 * 068 * @return The base directory of the current project or {@code null} if none. 069 */ 070 File getProjectDirectory(); 071 072 /** 073 * Gets current calculated project properties 074 * 075 * @return The project properties, never {@code null}. 076 */ 077 Map<String, String> getProjectProperties(); 078 079 }