Package org.bonitasoft.plugin
Class MavenSessionExecutor
java.lang.Object
org.bonitasoft.plugin.MavenSessionExecutor
Executes maven requests with information from an active session.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classException thrown when the maven build fails. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(File pomFile, File rootModuleDirectory, List<String> goals, Map<String, String> properties, List<String> activeProfiles, Supplier<String> errorMessageBase) Execute maven commands on a pom file.voidexecute(File pomFile, File rootModuleDirectory, List<String> goals, Map<String, String> properties, List<String> extraArguments, List<String> activeProfiles, Supplier<String> errorMessageBase) Execute maven commands on a pom file.static org.bonitasoft.bonita2bar.MavenExecutorforBarFromSession(org.apache.maven.execution.MavenSession session) Get the maven executor from the maven sessionstatic MavenSessionExecutorfromSession(org.apache.maven.execution.MavenSession session) Get the maven executor from the maven 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.BuildExceptionExecute maven commands on a pom file.- Parameters:
pomFile- the pom filerootModuleDirectory- the root module directory, used to set the base directory for multi-module buildsgoals- the goals to executeproperties- user properties to pass as -D argumentsactiveProfiles- the active profiles to useerrorMessageBase- 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.BuildExceptionExecute maven commands on a pom file.- Parameters:
pomFile- the pom filerootModuleDirectory- the root module directory, used to set the base directory for multi-module buildsgoals- the goals to executeproperties- user properties to pass as -D argumentsextraArguments- additional arguments to pass to the maven command (such as "-fn")activeProfiles- the active profiles to useerrorMessageBase- 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
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
-