Package org.apache.maven.plugins.invoker
Class InvokerSession
- java.lang.Object
-
- org.apache.maven.plugins.invoker.InvokerSession
-
class InvokerSession extends java.lang.ObjectTracks a set of build jobs and their results.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<BuildJob>buildJobsprivate java.util.List<BuildJob>errorJobsprivate java.util.List<BuildJob>failedJobsprivate static java.lang.StringSEPARATORprivate java.util.List<BuildJob>skippedJobsprivate java.util.List<BuildJob>successfulJobs
-
Constructor Summary
Constructors Constructor Description InvokerSession()Creates a new empty session.InvokerSession(java.util.List<BuildJob> buildJobs)Creates a session that initially contains the specified build jobs.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddJob(BuildJob buildJob)Adds the specified build job to this session.java.util.List<BuildJob>getErrorJobs()Gets the build jobs which had errors for this session.java.util.List<BuildJob>getFailedJobs()Gets the failed build jobs in this session.java.util.List<BuildJob>getJobs()Gets the build jobs in this session.java.util.List<BuildJob>getSkippedJobs()Gets the skipped build jobs in this session.java.util.List<BuildJob>getSuccessfulJobs()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, java.lang.String header, java.util.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, java.lang.String message)Log message in correct level depends on flag.private voidresetStats()voidsetJobs(java.util.List<? extends BuildJob> buildJobs)Sets the build jobs of this session.private voidupdateStats()
-
-
-
Field Detail
-
SEPARATOR
private static final java.lang.String SEPARATOR
-
buildJobs
private java.util.List<BuildJob> buildJobs
-
failedJobs
private java.util.List<BuildJob> failedJobs
-
errorJobs
private java.util.List<BuildJob> errorJobs
-
successfulJobs
private java.util.List<BuildJob> successfulJobs
-
skippedJobs
private java.util.List<BuildJob> skippedJobs
-
-
Constructor Detail
-
InvokerSession
InvokerSession()
Creates a new empty session.
-
InvokerSession
InvokerSession(java.util.List<BuildJob> buildJobs)
Creates a session that initially contains the specified build jobs.- Parameters:
buildJobs- The build jobs to set, must not benull.
-
-
Method Detail
-
addJob
public void addJob(BuildJob buildJob)
Adds the specified build job to this session.- Parameters:
buildJob- The build job to add, must not benull.
-
setJobs
public void setJobs(java.util.List<? extends BuildJob> buildJobs)
Sets the build jobs of this session.- Parameters:
buildJobs- The build jobs to set, must not benull.
-
getJobs
public java.util.List<BuildJob> getJobs()
Gets the build jobs in this session.- Returns:
- The build jobs in this session, can be empty but never
null.
-
getSuccessfulJobs
public java.util.List<BuildJob> getSuccessfulJobs()
Gets the successful build jobs in this session.- Returns:
- The successful build jobs in this session, can be empty but never
null.
-
getFailedJobs
public java.util.List<BuildJob> getFailedJobs()
Gets the failed build jobs in this session.- Returns:
- The failed build jobs in this session, can be empty but never
null.
-
getErrorJobs
public java.util.List<BuildJob> 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
public java.util.List<BuildJob> 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.MojoFailureExceptionHandles 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, java.lang.String header, java.util.List<BuildJob> buildJobs)Log list of jobs.- Parameters:
logger- logger to writewarn- flag indicate log levelbuildJobs- jobs to list
-
logWithLevel
private void logWithLevel(org.apache.maven.plugin.logging.Log logger, boolean warn, java.lang.String message)Log message in correct level depends on flag.- Parameters:
logger- logger to writewarn- flag indicate log levelmessage- message to write
-
-