Class InvokerSession

java.lang.Object
org.apache.maven.plugins.invoker.InvokerSession

class InvokerSession extends Object
Tracks a set of build jobs and their results.
  • Field Details

  • Constructor Details

    • InvokerSession

      InvokerSession()
      Creates a new empty session.
    • InvokerSession

      InvokerSession(List<BuildJob> buildJobs)
      Creates a session that initially contains the specified build jobs.
      Parameters:
      buildJobs - The build jobs to set, must not be null.
  • Method Details

    • addJob

      public void addJob(BuildJob buildJob)
      Adds the specified build job to this session.
      Parameters:
      buildJob - The build job to add, must not be null.
    • setJobs

      public void setJobs(List<? extends BuildJob> buildJobs)
      Sets the build jobs of this session.
      Parameters:
      buildJobs - The build jobs to set, must not be null.
    • getJobs

      public 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 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 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 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 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 be null.
      ignoreFailures - A flag whether failures should be ignored or whether a build failure should be signaled.
    • 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 be null.
      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.