Package hudson.maven

Interface MavenArgumentInterceptorAction

All Superinterfaces:
Action, ModelObject

public interface MavenArgumentInterceptorAction extends Action
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)
  • Method Details

    • getGoalsAndOptions

      String getGoalsAndOptions(MavenModuleSetBuild build)
      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.

      Parameters:
      build - reference to the current build, might be used for some calculations for the correct arguments
      Returns:
      the maven goals and options to start maven with. Result is ignored if null or empty. Variables will be expanded by the caller.
    • intercept

      Change/add arguments to any needs. 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).

      Parameters:
      mavenargs - the calculated default maven arguments (never null).
      build - reference to the current build, might be used for some calculations for the correct arguments
      Returns:
      the new arguments to be used.