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 TypeMethodDescriptionvoidAdds 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.voidhandleFailures(org.apache.maven.plugin.logging.Log logger, boolean ignoreFailures) Handles the build failures in this session.private voidlogBuildJobList(org.apache.maven.plugin.logging.Log logger, boolean warn, String header, List<BuildJob> buildJobs) Log list of jobs.voidlogFailedBuildLog(org.apache.maven.plugin.logging.Log logger, boolean ignoreFailures) voidlogSummary(org.apache.maven.plugin.logging.Log logger, boolean ignoreFailures) Prints a summary of this session to the specified logger.private voidlogWithLevel(org.apache.maven.plugin.logging.Log logger, boolean warn, String message) Log message in correct level depends on flag.private voidvoidSets 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
-
-
Method Details
-
addJob
Adds the specified build job to this session.- Parameters:
buildJob- The build job to add, must not benull.
-
setJobs
-
getJobs
-
getSuccessfulJobs
-
getFailedJobs
-
getErrorJobs
-
getSkippedJobs
-
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
-
logWithLevel
Log message in correct level depends on flag.- Parameters:
logger- logger to writewarn- flag indicate log levelmessage- message to write
-