Class CoverallsReportMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.eluder.coveralls.maven.plugin.CoverallsReportMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

@Mojo(name="report", threadSafe=false, aggregator=true) public class CoverallsReportMojo extends org.apache.maven.plugin.AbstractMojo
The Class CoverallsReportMojo.
  • Constructor Details

    • CoverallsReportMojo

      public CoverallsReportMojo()
      Instantiates a new coveralls report mojo.
  • Method Details

    • execute

      public final void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • createCoverageParsers

      protected List<CoverageParser> createCoverageParsers(SourceLoader sourceLoader) throws IOException
      Creates the coverage parsers.
      Parameters:
      sourceLoader - source loader that extracts source files
      Returns:
      coverage parsers for all maven modules and additional reports
      Throws:
      IOException - if parsers cannot be created
    • createSourceLoader

      protected SourceLoader createSourceLoader(Job job)
      Creates the source loader.
      Parameters:
      job - the job describing the coveralls report
      Returns:
      source loader that extracts source files
    • createEnvironment

      protected Environment createEnvironment()
      Creates the environment.
      Returns:
      environment to setup mojo and service specific properties
    • getServices

      protected List<ServiceSetup> getServices()
      Gets the services.
      Returns:
      list of available continuous integration services
    • createJob

      protected Job createJob() throws ProcessingException, IOException
      Creates the job.
      Returns:
      job that describes the coveralls report
      Throws:
      ProcessingException - if processing of timestamp fails
      IOException - if an I/O error occurs
    • createJsonWriter

      protected JsonWriter createJsonWriter(Job job) throws IOException
      Creates the json writer.
      Parameters:
      job - the job describing the coveralls report
      Returns:
      JSON writer that writes the coveralls data
      Throws:
      IOException - if an I/O error occurs
    • createCoverallsClient

      protected CoverallsClient createCoverallsClient()
      Creates the coveralls client.
      Returns:
      http client that submits the coveralls data
    • createSourceCallbackChain

      protected SourceCallback createSourceCallbackChain(JsonWriter writer, List<Logger> reporters)
      Creates the source callback chain.
      Parameters:
      writer - the JSON writer
      reporters - the logging reporters
      Returns:
      source callback chain for different source handlers
    • writeCoveralls

      protected void writeCoveralls(JsonWriter writer, SourceCallback sourceCallback, List<CoverageParser> parsers) throws ProcessingException, IOException
      Writes coverage data to JSON file.
      Parameters:
      writer - JSON writer that writes the coveralls data
      sourceCallback - the source callback handler
      parsers - list of coverage parsers
      Throws:
      ProcessingException - if process to to create JSON file fails
      IOException - if an I/O error occurs