Package org.apache.maven.plugins.invoker
Class InvokerSession
java.lang.Object
org.apache.maven.plugins.invoker.InvokerSession
Tracks a set of build jobs and their results.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty session.InvokerSession
(List<BuildJob> buildJobs) Creates a session that initially contains the specified build jobs. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the specified build job to this session.Gets the build jobs which had errors for this session.Gets the failed build jobs in this session.getJobs()
Gets the build jobs in this session.Gets the skipped build jobs in this session.Gets the successful build jobs in this session.void
handleFailures
(org.apache.maven.plugin.logging.Log logger, boolean ignoreFailures) Handles the build failures in this session.private void
logBuildJobList
(org.apache.maven.plugin.logging.Log logger, boolean warn, String header, List<BuildJob> buildJobs) Log list of jobs.void
logFailedBuildLog
(org.apache.maven.plugin.logging.Log logger, boolean ignoreFailures) void
logSummary
(org.apache.maven.plugin.logging.Log logger, boolean ignoreFailures) Prints a summary of this session to the specified logger.private void
logWithLevel
(org.apache.maven.plugin.logging.Log logger, boolean warn, String message) Log message in correct level depends on flag.private void
void
Sets the build jobs of this session.private void
-
Field Details
-
SEPARATOR
-
buildJobs
-
failedJobs
-
errorJobs
-
successfulJobs
-
skippedJobs
-
-
Constructor Details
-
InvokerSession
InvokerSession()Creates a new empty session. -
InvokerSession
Creates a session that initially contains the specified build jobs.- Parameters:
buildJobs
- The build jobs to set, must not benull
.
-
-
Method Details
-
addJob
Adds the specified build job to this session.- Parameters:
buildJob
- The build job to add, must not benull
.
-
setJobs
Sets the build jobs of this session.- Parameters:
buildJobs
- The build jobs to set, must not benull
.
-
getJobs
Gets the build jobs in this session.- Returns:
- The build jobs in this session, can be empty but never
null
.
-
getSuccessfulJobs
Gets the successful build jobs in this session.- Returns:
- The successful build jobs in this session, can be empty but never
null
.
-
getFailedJobs
Gets the failed build jobs in this session.- Returns:
- The failed build jobs in this session, can be empty but never
null
.
-
getErrorJobs
Gets the build jobs which had errors for this session.- Returns:
- The build jobs in error for this session, can be empty but never
null
.
-
getSkippedJobs
Gets the skipped build jobs in this session.- Returns:
- The skipped build jobs in this session, can be empty but never
null
.
-
resetStats
private void resetStats() -
updateStats
private void updateStats() -
logSummary
public void logSummary(org.apache.maven.plugin.logging.Log logger, boolean ignoreFailures) Prints a summary of this session to the specified logger.- Parameters:
logger
- The mojo logger to output messages to, must not benull
.ignoreFailures
- A flag whether failures should be ignored or whether a build failure should be signaled.
-
logFailedBuildLog
public void logFailedBuildLog(org.apache.maven.plugin.logging.Log logger, boolean ignoreFailures) throws org.apache.maven.plugin.MojoFailureException - Throws:
org.apache.maven.plugin.MojoFailureException
-
handleFailures
public void handleFailures(org.apache.maven.plugin.logging.Log logger, boolean ignoreFailures) throws org.apache.maven.plugin.MojoFailureException Handles the build failures in this session.- Parameters:
logger
- The mojo logger to output messages to, must not benull
.ignoreFailures
- A flag whether failures should be ignored or whether a build failure should be signaled.- Throws:
org.apache.maven.plugin.MojoFailureException
- If failures are present and not ignored.
-
logBuildJobList
private void logBuildJobList(org.apache.maven.plugin.logging.Log logger, boolean warn, String header, List<BuildJob> buildJobs) Log list of jobs.- Parameters:
logger
- logger to writewarn
- flag indicate log levelbuildJobs
- jobs to list
-
logWithLevel
Log message in correct level depends on flag.- Parameters:
logger
- logger to writewarn
- flag indicate log levelmessage
- message to write
-