Class MavenSessionExecutor

java.lang.Object
org.bonitasoft.plugin.MavenSessionExecutor

public class MavenSessionExecutor extends Object
Executes maven requests with information from an active session.
  • Method Details

    • execute

      public void execute(File pomFile, File rootModuleDirectory, List<String> goals, Map<String,String> properties, List<String> activeProfiles, Supplier<String> errorMessageBase) throws MavenSessionExecutor.BuildException
      Execute maven commands on a pom file.
      Parameters:
      pomFile - the pom file
      rootModuleDirectory - the root module directory, used to set the base directory for multi-module builds
      goals - the goals to execute
      properties - user properties to pass as -D arguments
      activeProfiles - the active profiles to use
      errorMessageBase - a supplier of the base error message to use in case of failure
      Throws:
      MavenSessionExecutor.BuildException - if an error occurs or the execution fails
    • execute

      public void execute(File pomFile, File rootModuleDirectory, List<String> goals, Map<String,String> properties, List<String> extraArguments, List<String> activeProfiles, Supplier<String> errorMessageBase) throws MavenSessionExecutor.BuildException
      Execute maven commands on a pom file.
      Parameters:
      pomFile - the pom file
      rootModuleDirectory - the root module directory, used to set the base directory for multi-module builds
      goals - the goals to execute
      properties - user properties to pass as -D arguments
      extraArguments - additional arguments to pass to the maven command (such as "-fn")
      activeProfiles - the active profiles to use
      errorMessageBase - a supplier of the base error message to use in case of failure
      Throws:
      MavenSessionExecutor.BuildException - if an error occurs or the execution fails
    • fromSession

      public static MavenSessionExecutor fromSession(org.apache.maven.execution.MavenSession session)
      Get the maven executor from the maven session
      Parameters:
      session - maven session
      Returns:
      executor relying on the session
    • forBarFromSession

      public static org.bonitasoft.bonita2bar.MavenExecutor forBarFromSession(org.apache.maven.execution.MavenSession session)
      Get the maven executor from the maven session
      Parameters:
      session - maven session
      Returns:
      executor relying on the session