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.
-
Field Summary
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<CoverageParser> createCoverageParsers(SourceLoader sourceLoader) Creates the coverage parsers.protected CoverallsClientCreates the coveralls client.protected EnvironmentCreates the environment.protected JobCreates the job.protected JsonWritercreateJsonWriter(Job job) Creates the json writer.protected SourceCallbackcreateSourceCallbackChain(JsonWriter writer, List<Logger> reporters) Creates the source callback chain.protected SourceLoadercreateSourceLoader(Job job) Creates the source loader.final voidexecute()protected List<ServiceSetup> Gets the services.protected voidwriteCoveralls(JsonWriter writer, SourceCallback sourceCallback, List<CoverageParser> parsers) Writes coverage data to JSON file.Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
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.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
createCoverageParsers
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
Creates the source loader.- Parameters:
job- the job describing the coveralls report- Returns:
- source loader that extracts source files
-
createEnvironment
Creates the environment.- Returns:
- environment to setup mojo and service specific properties
-
getServices
Gets the services.- Returns:
- list of available continuous integration services
-
createJob
Creates the job.- Returns:
- job that describes the coveralls report
- Throws:
ProcessingException- if processing of timestamp failsIOException- if an I/O error occurs
-
createJsonWriter
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
Creates the coveralls client.- Returns:
- http client that submits the coveralls data
-
createSourceCallbackChain
Creates the source callback chain.- Parameters:
writer- the JSON writerreporters- 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 datasourceCallback- the source callback handlerparsers- list of coverage parsers- Throws:
ProcessingException- if process to to create JSON file failsIOException- if an I/O error occurs
-