All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hudson.maven.MavenArgumentInterceptorAction Maven / Gradle / Ivy

Go to download

This plug-in provides deep integration of Hudson and Maven. This functionality used to be part of the Hudson core. Now it is a plug-in that is installed by default, but can be disabled.

The newest version!
/*******************************************************************************
 *
 * Copyright (c) 2004-2009 Oracle Corporation.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors: 
 *
 *    Dominik Bartholdi (imod)
 *     
 *******************************************************************************/

package hudson.maven;

import hudson.model.Action;
import hudson.util.ArgumentListBuilder;

/**
 * Provides a hook to change the arguments passed to the maven execution. This
 * enables plugins to transiently change the arguments of a maven build (e.g.
 * change the arguments for a release build).
 * 
 * @author Dominik Bartholdi (imod)
 * 
 */
public interface MavenArgumentInterceptorAction extends Action {

	/**
	 * Provides maven goals and options to start the build with. This is the
	 * preferred way to provide other goals then the default ones to a build.
	 * The goals and options returned by this method will not be persist and do
	 * not affect the default configuration.
	 * 

* This method will be called on one and only one action during a build. If * there are two actions present in the build, the second will be ignored. * * @param build * reference to the current build, might be used for some * calculations for the correct arguments * @return the maven goals and options to start maven with. Result is * ignored if null or empty. Variables will be expanded * by the caller. */ public String getGoalsAndOptions(MavenModuleSetBuild build); /** * Change/add arguments to any needs, but special care has to be taken, as * the list contains every argument needed for the default execution (e.g. * -f /path/to/pom.xml or -B).
* An easy example would be to add "-DskipTests" to skip the * test execution on request. * *

* This method is called on all present MavenArgumentInterceptorAction * during a build (kind of chaining, each action can add the arguments it * thinks are missing). * * @param mavenargs * the calculated default maven arguments (never * null). * @param build * reference to the current build, might be used for some * calculations for the correct arguments * @return the new arguments to be used. */ public ArgumentListBuilder intercept(ArgumentListBuilder mavenargs, MavenModuleSetBuild build); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy