Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* dpkg - Debian Package library and the Debian Package Maven plugin
* (c) Copyright 2016 Gerrit Hohl
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package net.sourceforge.javadpkg.plugin;
import java.util.Map;
import org.apache.maven.project.MavenProject;
import org.apache.maven.settings.Settings;
import net.sourceforge.javadpkg.plugin.reflect.PropertyReflection;
import net.sourceforge.javadpkg.plugin.reflect.PropertyReflectionException;
import net.sourceforge.javadpkg.plugin.reflect.PropertyReflectionImpl;
import net.sourceforge.javadpkg.replace.ReplacementException;
import net.sourceforge.javadpkg.replace.Replacements;
/**
*
* The replacements which are based on the plug-in properties, the
* {@link MavenProject}, the environment variables (see {@link System#getenv()})
* and the system properties (see {@link System#getProperties()}).
*
*
* If the value of a variable is requested by calling the
* {@link #getValue(String)} method the lookup of the variable is performed the
* following way:
*
*
Does the variable exist in the plug-in properties? If yes, return the
* value.
*
Does the variable exist in the {@link MavenProject} properties (see
* {@link MavenProject#getProperties()})? If yes, return the value.
*
Does the variable - removing the leading "project" /
* "project." - exist in the {@link MavenProject} as property? If yes,
* return the value.
*
Does the variable - removing the leading "env" /
* "env." - exist as a environment variable? If yes, return the value.
*
*
Does the variable exist as a system property? If yes, return the value.
*
*
Otherwise return null.
*
*
*
*
* @author Gerrit Hohl ([email protected])
* @version 1.0, 04.05.2016 by Gerrit Hohl
*/
public class ReplacementsMaven implements Replacements {
/** The "project" variable. */
private static final String PROJECT_VAR = "project";
/** The prefix for all "project" variables. */
private static final String PROJECT_VAR_PREFIX = PROJECT_VAR + ".";
/** The "settings" variable. */
private static final String SETTINGS_VAR = "settings";
/** The prefix for all "settings" variables. */
private static final String SETTINGS_VAR_PREFIX = SETTINGS_VAR + ".";
/** The "env" variable. */
private static final String ENV_VAR = "env";
/** The prefix for all "env" variables. */
private static final String ENV_VAR_PREFIX = ENV_VAR + ".";
/** The properties of the plug-in configuration. */
private Map