Showing preview only (454K chars total). Download the full file or copy to clipboard to get everything.
Repository: trautonen/coveralls-maven-plugin
Branch: master
Commit: 773a396fa382
Files: 134
Total size: 410.1 KB
Directory structure:
gitextract_4r5n4qdh/
├── .gitignore
├── .gitmodules
├── .travis.yml
├── CHANGELOG.md
├── LICENSE.MIT
├── MIGRATION.md
├── README.md
├── README_2_x.md
├── pom.xml
├── sample/
│ ├── README.md
│ ├── module1/
│ │ ├── pom.xml
│ │ └── src/
│ │ ├── main/
│ │ │ ├── java/
│ │ │ │ └── org/
│ │ │ │ └── eluder/
│ │ │ │ └── coverage/
│ │ │ │ └── sample/
│ │ │ │ ├── InnerClassCoverage.java
│ │ │ │ └── SimpleCoverage.java
│ │ │ └── resources/
│ │ │ ├── Components.js
│ │ │ └── Localization.js
│ │ └── test/
│ │ ├── java/
│ │ │ └── org/
│ │ │ └── eluder/
│ │ │ └── coverage/
│ │ │ └── sample/
│ │ │ ├── InnerClassCoverageTest.java
│ │ │ └── SimpleCoverageTest.java
│ │ └── specs/
│ │ └── ComponentsSpec.coffee
│ ├── module2/
│ │ ├── pom.xml
│ │ └── src/
│ │ ├── main/
│ │ │ └── java/
│ │ │ └── org/
│ │ │ └── eluder/
│ │ │ └── coverage/
│ │ │ └── sample/
│ │ │ └── PartialCoverage.java
│ │ └── test/
│ │ └── java/
│ │ └── org/
│ │ └── eluder/
│ │ └── coverage/
│ │ └── sample/
│ │ ├── PartialCoverageIT.java
│ │ └── PartialCoverageTest.java
│ └── pom.xml
├── scripts/
│ ├── bump-version.sh
│ ├── functions.sh
│ └── release.sh
└── src/
├── main/
│ └── java/
│ └── org/
│ └── eluder/
│ └── coveralls/
│ └── maven/
│ └── plugin/
│ ├── CoverageParser.java
│ ├── CoverallsReportMojo.java
│ ├── Environment.java
│ ├── ProcessingException.java
│ ├── domain/
│ │ ├── Branch.java
│ │ ├── CoverallsResponse.java
│ │ ├── Git.java
│ │ ├── GitRepository.java
│ │ ├── Job.java
│ │ ├── JsonObject.java
│ │ └── Source.java
│ ├── httpclient/
│ │ ├── CoverallsClient.java
│ │ ├── CoverallsProxyClient.java
│ │ └── HttpClientFactory.java
│ ├── json/
│ │ └── JsonWriter.java
│ ├── logging/
│ │ ├── CoverageTracingLogger.java
│ │ ├── DryRunLogger.java
│ │ ├── JobLogger.java
│ │ └── Logger.java
│ ├── parser/
│ │ ├── AbstractXmlEventParser.java
│ │ ├── CoberturaParser.java
│ │ ├── JaCoCoParser.java
│ │ └── SagaParser.java
│ ├── service/
│ │ ├── AbstractServiceSetup.java
│ │ ├── Appveyor.java
│ │ ├── Bamboo.java
│ │ ├── Circle.java
│ │ ├── General.java
│ │ ├── Jenkins.java
│ │ ├── ServiceSetup.java
│ │ ├── Shippable.java
│ │ ├── Travis.java
│ │ └── Wercker.java
│ ├── source/
│ │ ├── AbstractSourceLoader.java
│ │ ├── ChainingSourceCallback.java
│ │ ├── DirectorySourceLoader.java
│ │ ├── MultiSourceLoader.java
│ │ ├── ScanSourceLoader.java
│ │ ├── SourceCallback.java
│ │ ├── SourceLoader.java
│ │ ├── UniqueSourceCallback.java
│ │ └── UrlSourceLoader.java
│ ├── util/
│ │ ├── CoverageParsersFactory.java
│ │ ├── ExistingFiles.java
│ │ ├── MavenProjectCollector.java
│ │ ├── Md5DigestInputStream.java
│ │ ├── SourceLoaderFactory.java
│ │ ├── TimestampParser.java
│ │ ├── UrlUtils.java
│ │ └── Wildcards.java
│ └── validation/
│ ├── JobValidator.java
│ ├── ValidationError.java
│ ├── ValidationErrors.java
│ └── ValidationException.java
└── test/
├── java/
│ └── org/
│ └── eluder/
│ └── coveralls/
│ └── maven/
│ └── plugin/
│ ├── CoverageFixture.java
│ ├── CoverallsReportMojoTest.java
│ ├── EnvironmentTest.java
│ ├── ProcessingExceptionTest.java
│ ├── domain/
│ │ ├── GitRepositoryTest.java
│ │ ├── JobTest.java
│ │ └── SourceTest.java
│ ├── httpclient/
│ │ ├── CoverallsClientTest.java
│ │ ├── CoverallsProxyClientTest.java
│ │ └── HttpClientFactoryTest.java
│ ├── json/
│ │ └── JsonWriterTest.java
│ ├── logging/
│ │ ├── CoverageTracingLoggerTest.java
│ │ ├── DryRunLoggerTest.java
│ │ └── JobLoggerTest.java
│ ├── parser/
│ │ ├── AbstractCoverageParserTest.java
│ │ ├── CoberturaParserTest.java
│ │ ├── JaCoCoParserTest.java
│ │ └── SagaParserTest.java
│ ├── service/
│ │ ├── AbstractServiceSetupTest.java
│ │ ├── AppveyorTest.java
│ │ ├── BambooTest.java
│ │ ├── CircleTest.java
│ │ ├── GeneralTest.java
│ │ ├── JenkinsTest.java
│ │ ├── ShippableTest.java
│ │ ├── TravisTest.java
│ │ └── WerckerTest.java
│ ├── source/
│ │ ├── DirectorySourceLoaderTest.java
│ │ ├── MultiSourceLoaderTest.java
│ │ ├── ScanSourceLoaderTest.java
│ │ ├── UniqueSourceCallbackTest.java
│ │ └── UrlSourceLoaderTest.java
│ ├── util/
│ │ ├── CoverageParsersFactoryTest.java
│ │ ├── ExistingFilesTest.java
│ │ ├── Md5DigestInputStreamTest.java
│ │ ├── SourceLoaderFactoryTest.java
│ │ ├── TestIoUtil.java
│ │ ├── TimestampParserTest.java
│ │ ├── UrlUtilsTest.java
│ │ └── WildcardsTest.java
│ └── validation/
│ ├── JobValidatorTest.java
│ ├── ValidationErrorTest.java
│ ├── ValidationErrorsTest.java
│ └── ValidationExceptionTest.java
└── resources/
├── Components.js
├── InnerClassCoverage.java
├── Localization.js
├── PartialCoverage.java
├── SimpleCoverage.java
├── cobertura.xml
├── jacoco1.xml
├── jacoco2-it.xml
├── jacoco2.xml
└── saga.xml
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
target
target/*
# Eclipse
.settings
.project
.classpath
# Idea
*.iml
.idea
# Atlassian
atlassian-ide-plugin.xml
================================================
FILE: .gitmodules
================================================
[submodule "etc"]
path = etc
url = git://github.com/trautonen/etc.git
================================================
FILE: .travis.yml
================================================
dist: xenial
language: java
sudo: false
jdk:
- openjdk8
- openjdk10
- openjdk11
env:
global:
- secure: "pmNBqCAW1rc4WKHEmnroZNwAMus18K1VWhRYwt+CN0acH8griJp612tjwWcI\n9XkZcSPR0CJx1TZqGDZZTFH44Pkm6ELU1kc54xtJR6WMXnubEVoEom0tcv/1\nNyzxv9UFJfaNgaTESww+OXSlO9wQre5ZS0/wn2xrz0+twtOPYDU="
- secure: "CZ9mejMLJdrh+a5TFXsNSiYyK9K/zNYOtubv2sPq1OEGhuohdUfLtdsk7bK9\nQcIlhZjrE5Q/wVgjZcFsnVpKhnUSRLC7sTOh6tu08EwpNtnNLl5AeUztOMCs\nxhG5H7jDu9uEH81WDZnIuK4Zq4qxXx523rnqQfk4DsTCKLVh9jI="
addons:
apt:
packages:
- python-yaml
before_install:
- git submodule update --init --recursive
before_script:
- python etc/travis-sonatype.py
script: python etc/travis-build.py --settings ~/.m2/sonatype.xml
after_success:
- mvn clean cobertura:cobertura org.eluder.coveralls:coveralls-maven-plugin:report
================================================
FILE: CHANGELOG.md
================================================
# Changelog
## 4.2.0
- #95, #96: Improved error message for misbehaving Coveralls API
- #92: Support for HTTP proxies in settings.xml
- #91: Support for epoch formatted timestamps
## 4.1.0
- #88: Support for AppVeyor CI
## 4.0.0
- #85: Merge coverages from multiple reports to single source file
- #84: Change source content to source digest per new Coveralls API
- #83: Require Java 7 to support new features and syntax
- #77: Support for custom build timestamp format
## 3.2.1
- #87: Downgraded jgit version to support Java 6
## 3.2.0
- #82: Improved error message for duplicate classes in different modules
- #76: Property to allow Coveralls service fail without build failure
- #74: Handle transitive logging dependencies better
## 3.1.0
- #67: Configurable project basedir
- #65, #66, #68: Support for Shippable CI
- #63: Directory scanning source loader
## 3.0.1
- #53: Improved error message for missing source encoding
- #52: Ignore duplicate source files on Cobertura aggregate mode
## 3.0.0
- #48: Removed support for URL based source loading due to Coveralls changes
- #42, #45, #46: Support Coveralls new GitHub based source view
- #40: Proper multi-module support and report aggregation
- #37, #41: Disclaimer for Java 8 usage
## 2.2.0
- #31: Improved error messages for Coveralls API failures
- #30: Improved error message for missing charset
- #28: More lenient XML parsing
- #26, #29: Support for Saga coverage tool and chain multiple coverage reports
## 2.1.0
- #24: Filter out remote names from git branches
- #19, #20: Skip configuration property to allow skipping of plugin execution
## 2.0.1
- #18: Update to HttpComponents HttpClient 4.3
- #15, #16, #17: Disable PKCS cryptography provider at runtime to work around OpenJDK SSL issue
## 2.0.0
- #13: Dry run property for test builds
- #12: Use ServiceSetup as secondary configuration source and Maven/VM properties as primary
- #11: Support multiple source directories
- #9: Support for other CI tools and platforms
- #8: Aggregated reports for multi-module projects
## 1.2.0
- #10: Validation of the Coveralls job
- #4: Report build timestamp to Coveralls
- #3: Log code lines from generated report to Maven console
## 1.1.0
- #1: Easier configuration for Travis CI
## 1.0.0
- Initial release
================================================
FILE: LICENSE.MIT
================================================
The MIT License (MIT)
Copyright (c) 2013 - 2016, Tapio Rautonen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================
FILE: MIGRATION.md
================================================
# Migration guide
Changes marked with bold affect the plugin usage. Other changes are only related to development
and codebase.
## 2.x to 3.x
-
## 1.x to 2.x
- **`sourceDirectory` parameter removed and replaced with a list parameter `sourceDirectories`**
- **service environment parameters do not override configuration parameters**
- `org.eluder.coveralls.maven.plugin.service.ServiceSetup` interface completely changed to reflect
the service specific configuration properly
- `org.eluder.coveralls.maven.plugin.service.Travis` changed to reflect the new service setup
interface
- `org.eluder.coveralls.maven.plugin.domain.JobValidator` and all validation related code is
now located in `org.eluder.coveralls.maven.plugin.validation` package
- `org.eluder.coveralls.maven.plugin.domain.GitRepository` does not take custom branch parameter
as constructor argument anymore, the same behavior is handled with the new service environment
setup
- `org.eluder.coveralls.maven.plugin.domain.Job` has only default constructor and initialization
is done with _with*_ methods, _validate()_ method returns list of validation errors instead of
throwing exception
- `org.eluder.coveralls.maven.plugin.domain.SourceLoader` constructor takes a list of source
directories instead of a single source directory
================================================
FILE: README.md
================================================
coveralls-maven-plugin
======================
[](http://unmaintained.tech/)
[](https://coveralls.io/r/trautonen/coveralls-maven-plugin?branch=master)
[](https://maven-badges.herokuapp.com/maven-central/org.eluder.coveralls/coveralls-maven-plugin/)
Maven plugin for submitting Java code coverage reports to [Coveralls](https://coveralls.io/) web
service.
## !!! Deprecated !!!
This project is deprecated due to lack of time and interest. Please use https://github.com/hazendaz/coveralls-maven-plugin from now on.
### Requirements
* Java 6 up to 3.x and Java 7 for 4.x onwards.
* Maven 3.0.0 or newer.
### Features
* Supports [Cobertura](http://mojo.codehaus.org/cobertura-maven-plugin/),
[JaCoCo](http://www.eclemma.org/jacoco/trunk/doc/maven.html) and
[Saga](http://timurstrekalov.github.io/saga/) coverage tools
* Multi-module report aggregation
* Built-in support for [Travis CI](https://travis-ci.org/), [Circle](https://circleci.com/),
[Codeship](https://www.codeship.io/), [Jenkins](http://jenkins-ci.org/),
[Bamboo](https://www.atlassian.com/software/bamboo/), [Shippable](https://www.shippable.com/)
and [Appveyor](http://www.appveyor.com/) continuous integration services
* Fully streaming implementation for fast report generation and small memory footprint
* Provides clean interfaces to allow easy extending to different coverage tools
* Convention over configuration for almost zero configuration usage
* Applies [semantic versioning](http://semver.org/)
### Usage
Set up the Coveralls maven plugin in the build section of the project pom.xml:
```xml
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>4.3.0</version>
<configuration>
<repoToken>yourcoverallsprojectrepositorytoken</repoToken>
</configuration>
</plugin>
```
#### Configuration
If used as a standalone Maven build or with any continuous integration server other than Travis
CI, the Coveralls repository token must be provided. This can be achieved by setting the
configuration section in the plugin or setting the Maven property `repoToken` to your coveralls
project repository token, using `-DrepoToken=yourcoverallsprojectrepositorytoken` when running the
maven command. **Do not publish your repository token in public GitHub repositories.** If you do,
anyone can submit coverage data without permission.
If you are using Travis CI, CircleCI, Codeship, Jenkins or Bamboo continuous integration services,
no other configuration is required. The plugin's built-in service environment support take care of
the rest. The plugin tries to find report files for any of the supported coverage tools and
finally aggregates the coverage report. Java 8 is currently supported only by JaCoCo.
See [Complete plugin configuration](#complete-plugin-configuration) for all of the available
configuration parameters.
#### Cobertura
Set up the Cobertura Maven plugin with XML report format in the build section of the project
pom.xml:
```xml
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
<configuration>
<format>xml</format>
<maxmem>256m</maxmem>
<!-- aggregated reports for multi-module projects -->
<aggregate>true</aggregate>
</configuration>
</plugin>
```
Execute Maven to create Cobertura report and submit Coveralls data:
```
mvn cobertura:cobertura coveralls:report
```
For example if you are using Travis CI this means you need to add to your `.travis.yml` the lines:
```
after_success:
- mvn clean cobertura:cobertura coveralls:report
```
#### JaCoCo
Set up the JaCoCo Maven plugin in the build section of the project pom.xml:
```xml
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.6.201602180812</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
```
Execute Maven to create JaCoCo report and submit Coveralls data:
```
mvn clean test jacoco:report coveralls:report
```
Again, if you are using Travis CI this means you need to add to your `.travis.yml` the lines:
```
after_success:
- mvn clean test jacoco:report coveralls:report
```
#### Saga
Set up the Saga Maven plugin in the build section of the project pom.xml:
```xml
<plugin>
<groupId>com.github.timurstrekalov</groupId>
<artifactId>saga-maven-plugin</artifactId>
<version>1.5.5</version>
<executions>
<execution>
<goals>
<goal>coverage</goal>
</goals>
</execution>
</executions>
<configuration>
<baseDir>http://localhost:${jasmine.serverPort}</baseDir>
<outputDir>${project.build.directory}/saga-coverage</outputDir>
<noInstrumentPatterns>
<pattern>.*/spec/.*</pattern>
<pattern>.*/classpath/.*</pattern>
<pattern>.*/webjars/.*</pattern>
</noInstrumentPatterns>
</configuration>
</plugin>
```
Note that Saga does not have default report output directory, but the plugin assumes
`${project.build.directory}/saga-coverage`.
Execute Maven to create Saga report and submit Coveralls data:
```
mvn clean test saga:coverage coveralls:report
```
And if you are using Travis CI this means you need to add to your `.travis.yml` the lines:
```
after_success:
- mvn clean test saga:coverage coveralls:report
```
#### Aggregate multiple reports
Report aggregation is applied by default and the only thing the user must take care of is to run
all the desired coverage tools. You can use JaCoCo in a multi-module project so that all modules
run JaCoCo separately and let the plugin aggregate the report, or you can run Saga and Cobertura
in same project and get coverage report for JavaScript and Java files.
Execute Maven to create Saga and Cobertura report and submit Coveralls data:
```
mvn clean test saga:coverage cobertura:cobertura coveralls:report
```
And if you are using Travis CI this means you need to add to your `.travis.yml` the lines:
```
after_success:
- mvn clean test saga:coverage cobertura:cobertura coveralls:report
```
### Complete plugin configuration
Configuration can be changed by the configuration section of plugin's definition in POM or with
Java virtual machine system properties using the syntax `-Dparameter=value`. See
[Maven plugin guide](http://maven.apache.org/guides/plugin/guide-java-plugin-development.html#Configuring_Parameters_in_a_Project)
how different types are mapped in the configuration XML. Some of the optional parameters are set
by the built-in service environment setups. Note that if a parameter is explicitly defined, the
service environment will not override it.
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `jacocoReports` | `List<File>` | List of additional JaCoCo report files. ${project.reporting.outputDirectory}/jacoco/jacoco.xml is used as default for every module. |
| `coberturaReports` | `List<File>` | List of additional Cobertura report files. ${project.reporting.outputDirectory}/cobertura/coverage.xml is used as default for every module. |
| `sagaReports` | `List<File>` | List of additional Saga report files. ${project.build.directory}/saga-coverage/total-coverage.xml is used as default for every module. |
| `relativeReportDirs` | `List<String>` | List of additional relative report directories. Directories relative to ${project.reporting.outputDirectory} and ${project.build.directory} are scanned for reports. |
| `coverallsFile` | `File` | **Default: ${project.build.directory}/coveralls.json**<br>File path to write and submit Coveralls data. |
| `coverallsUrl` | `String` | **Default: https://coveralls.io/api/v1/jobs**<br>Url for the Coveralls API. |
| `sourceDirectories` | `List<File>` | List of additional source directories. The plugin will scan the project's compiled source roots for defaults. |
| `sourceEncoding` | `String` | **Default: ${project.build.sourceEncoding}**<br>Source file encoding. |
| `serviceName` | `String` | CI service name. If not provided the supported service environments are used. |
| `serviceJobId` | `String` | CI service job id. Currently supported only with Travis CI. If this property is set, `repoToken` is not required. If not provided the supported service environments are used. |
| `serviceBuildNumber` | `String` | CI service build number. If not provided the supported service environments are used. |
| `serviceBuildUrl` | `String` | CI service build url. If not provided the supported service environments are used. |
| `serviceEnvironment` | `Properties` | CI service specific environment properties. If not provided the supported service environments are used. |
| `repoToken` | `String` | Coveralls repository token. **Do not publish this parameter unencrypted in public GitHub repositories.** |
| `parallel` | `boolean` | **Default: false**<br> Coveralls API flag: If this is set, the build will not be considered done until a webhook has been sent to https://coveralls.io/webhook?repo_token=… |
| `branch` | `String` | Git branch name. If not provided the supported service environments are used. |
| `pullRequest` | `String` | GitHub pull request identifier. If not provided the supported service environments are used. |
| `timestampFormat` | `String` | **Default: ${maven.build.timestamp}**<br>Build timestamp format. Must be in format supported by SimpleDateFormat. |
| `timestamp` | `String` | **Default: ${timestamp}**<br>Build timestamp. Must be in format defined by 'timestampFormat' if it's available or in default timestamp format yyyy-MM-dd'T'HH:mm:ss'Z'. |
| `dryRun` | `boolean` | **Default: false**<br>Dry run Coveralls report without actually sending it. |
| `failOnServiceError` | `boolean` | **Default: true**<br> Fail build if Coveralls service is not available or submission fails for internal errors. |
| `scanForSources` | `boolean` | **Default: false**<br>Scan subdirectories for source files. |
| `coveralls.basedir` | `File` | **Default: ${project.basedir}**<br>Base directory of the project. |
| `coveralls.skip` | `boolean` | **Default: false**<br>Skip the plugin execution. |
### FAQ
> **Q:** How do I know that my coverage report was submitted successfully to Coveralls?
> **A:** The plugin will end with BUILD SUCCESS and the log contains the reported job id and
> direct URL to Coveralls.
<!-- -->
> **Q:** I get BUILD SUCCESS but why Coveralls shows only question marks in the reports?
> **A:** The data is most likely reported correctly, but Coveralls might take hours, or even a
> day, to update the actual coverage numbers.
<!-- -->
> **Q:** Can I use Java 8 with the plugin?
> **A:** Yes. The Coveralls plugin works fine with Java 8, but the problem is the coverage tools.
> Currently only tool supporting Java 8 is JaCoCo. You can use JaCoCo in a single module or
> a multi-module project and let the Coveralls plugin handle the report aggregation. This is not
> true aggregation though and does not address cross module coverage calculation (see
> https://github.com/jacoco/jacoco/pull/97)
<!-- -->
> **Q:** Build fails with 'javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated'
> exception, what to do?
> **A:** If the build is run with OpenJDK, you probably hit an issue with the Cryptography Package
> Providers not supporting all Elliptic Curves. The [issue](https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/1006776)
> is described in the Ubuntu issue tracker. A workaround is to disable the PKCS provider from the
> `java.security` options file.
> ```
> sudo sed -i 's/security.provider.9/#security.provider.9/g' $JAVA_HOME/jre/lib/security/java.security
> ```
> In Travis CI the above command can be added to before_install phase. See complete example from
> this project's `.travis.yml`.
<!-- -->
> **Q:** How can I use Scala or some other project which sources reside in other folder than
> `src/main/java`?
> **A:** The plugin uses all compiled source roots available for the project at runtime. If the
> source directories are available, everything is fine. Otherwise additional source directories
> can be applied with `sourceDirectories` configuration parameter that takes a Maven configuration
> style list of source directories.
<!-- -->
> **Q:** How can I set the plugin to use multiple source directories?
> **A:** For multi-module projects, the plugin automatically scans the project hierarchy and adds
> all required source directories. You can also customize the used source directories with
> `sourceDirectories` configuration parameter that takes a Maven configuration style list of
> source directories.
<!-- -->
> **Q:** Why source files are not found for generated sources?
> **A:** Generated source directories under target are not added to the sources list
> automatically. It is often not good practice to test generated code, because the code is not
> managed by the project under test, unless you are testing a source generator. Cobertura and
> JaCoCo both have `<excludes>` configuration directive that provides ignoring of class files. If
> the generated sources still must be tested, all source directories can be explicitly defined
> with `sourceDirectories` configuration parameter.
<!-- -->
> **Q:** JaCoCo or Cobertura, which one should i choose?
> **A:** For multi-module projects, only Cobertura supports report aggregation out of the box. The
> coverage metrics and performance of the two plugins are not much different for a small or medium
> sized project, but there are 2 notable differences with the tools:
> - JaCoCo does not track how many times a single line of code is hit by all the tests together,
> so Coveralls is always reported with 1 as the number of hits if the line is covered. Cobertura
> tracks the number of hits and the number is reported to Coveralls.
> - Cobertura tracks all inner classes separately, so a single source file will contain multiple
> records with same file name in Coveralls if there are any innner classes defined. The
> coveralls-maven-plugin adds classifier from the inner class to distinguish the files, but if
> there are lot of inner classes defined this creates some noise to the Coveralls reports. JaCoCo
> tracks inner classes within same source file so each source file is only reported once to
> Coveralls.
### Changelog
See [changelog](CHANGELOG.md) for more details.
### Migration
See [migration](MIGRATION.md) documentation for more information.
### Credits
- Jakub Bednář (@bednar) for Saga integration and the idea of chaining multiple reports provided
by different coverage tools.
- Marvin Froeder (@velo) for Shippable and Appveyor support, configurable basedir and directory
scanning source loader.
- Pasi Niemi (@psiniemi) for coverage merging from different reports to single source file.
### Continuous integration
Travis CI builds the plugin with Oracle JDK 7. All successfully built snapshots are deployed to
Sonatype OSS repository. Cobertura is used to gather coverage metrics and the report is submitted
to Coveralls with this plugin.
### Using test versions
Add the following repository configurations to your `pom.xml` to enable snapshot versions of this
plugin to be used.
```xml
<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>sonatype-nexus-snapshot</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
```
### License
The project coveralls-maven-plugin is licensed under the MIT license.
================================================
FILE: README_2_x.md
================================================
coveralls-maven-plugin
======================
[](https://travis-ci.org/trautonen/coveralls-maven-plugin)
[](https://coveralls.io/r/trautonen/coveralls-maven-plugin?branch=master)
Maven plugin for submitting Java code coverage reports to [Coveralls](https://coveralls.io/) web
service.
### Features
* Supports [Cobertura](http://mojo.codehaus.org/cobertura-maven-plugin/),
[JaCoCo](http://www.eclemma.org/jacoco/trunk/doc/maven.html) and
[Saga](http://timurstrekalov.github.io/saga/) coverage tools
* Multi-module report aggregation with Cobertura
* Built-in support for [Travis CI](https://travis-ci.org/), [Circle](https://circleci.com/),
[Codeship](https://www.codeship.io/), [Jenkins](http://jenkins-ci.org/) and
[Bamboo](https://www.atlassian.com/software/bamboo/) continuous integration services
* Fully streaming implementation for fast report generation and small memory footprint
* Provides clean interfaces to allow easy extending to different coverage tools
* Convention over configuration for almost zero configuration usage
* Applies [semantic versioning](http://semver.org/)
### Usage
Set up the Coveralls maven plugin in the build section of the project pom.xml:
```xml
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>2.2.0</version>
<configuration>
<repoToken>yourcoverallsprojectrepositorytoken</repoToken>
</configuration>
</plugin>
```
#### Configuration
If used as a standalone Maven build or with any continuous integration server other than Travis
CI, the Coveralls repository token must be provided. This can be achieved by setting the
configuration section in the plugin or setting the Maven property `repoToken` to your coveralls project repository token, using
`-DrepoToken=yourcoverallsprojectrepositorytoken` when running the maven command. **Do not publish
your repository token in public GitHub repositories.** If you do, anyone can submit coverage data without permission.
If you are using Travis CI, Circle, Codeship, Jenkins or Bamboo continuous integration services, no
other configuration is required. The plugin's built-in service environment support take care of
the rest. Multi-module projects that require aggregated reports have to set up Cobertura Maven
plugin for the root project with `aggregate=true`. For other projects you are free to choose
either [Cobertura](#cobertura) or [JaCoCo](#jacoco) plugin. Finally add the corresponding Maven
command for the selected plugin to your continuous integration service build job.
See [Complete plugin configuration](#complete-plugin-configuration) for all of the available
configuration parameters.
#### Cobertura
Set up the Cobertura Maven plugin with XML report format in the build section of the project
pom.xml:
```xml
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.6</version>
<configuration>
<format>xml</format>
<maxmem>256m</maxmem>
<!-- aggregated reports for multi-module projects -->
<aggregate>true</aggregate>
</configuration>
</plugin>
```
Execute Maven to create Cobertura report and submit Coveralls data:
```
mvn cobertura:cobertura coveralls:cobertura
```
For example if you are using Travis CI this means you need to add to your `.travis.yml` the lines:
```
after_success:
- mvn clean cobertura:cobertura coveralls:cobertura
```
#### JaCoCo
Set up the JaCoCo Maven plugin in the build section of the project pom.xml:
```xml
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.2.201409121644</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
```
Execute Maven to create JaCoCo report and submit Coveralls data:
```
mvn clean test jacoco:report coveralls:jacoco
```
Again, if you are using Travis CI this means you need to add to your `.travis.yml` the lines:
```
after_success:
- mvn clean test jacoco:report coveralls:jacoco
```
#### Saga
Set up the Saga Maven plugin in the build section of the project pom.xml:
```xml
<plugin>
<groupId>com.github.timurstrekalov</groupId>
<artifactId>saga-maven-plugin</artifactId>
<version>1.5.2</version>
<executions>
<execution>
<goals>
<goal>coverage</goal>
</goals>
</execution>
</executions>
<configuration>
<baseDir>http://localhost:${jasmine.serverPort}</baseDir>
<outputDir>${project.build.directory}/saga-coverage</outputDir>
<noInstrumentPatterns>
<pattern>.*/spec/.*</pattern>
</noInstrumentPatterns>
</configuration>
</plugin>
```
You should also set the `sourceUrls` parameter for the plugin to load the sources from Jaasmine
server. This allows creating coverage reports also for example CoffeeScript sources:
```xml
<sourceUrls>
<sourceUrl>http://localhost:${jasmine.serverPort}</sourceUrl>
</sourceUrls>
```
Execute Maven to create Saga report and submit Coveralls data:
```
mvn clean test saga:coverage coveralls:saga
```
And if you are using Travis CI this means you need to add to your `.travis.yml` the lines:
```
after_success:
- mvn clean test saga:coverage coveralls:saga
```
#### Chain
Create Coveralls data from multiple coverage tools.
*Note: The chaining approach will be the default approach for future versions of coveralls maven
plugin usage. Probably with the difference that the goal is changed from `chain` to `report`.*
Configure the coverage plugins as described earlier and instead of single coverage tool goal
use the `chain` goal to aggregate all coverage sources.
Execute Maven to create Cobertura and Saga report and submit Coveralls data:
```
mvn clean test saga:coverage cobertura:cobertura coveralls:chain
```
And if you are using Travis CI this means you need to add to your `.travis.yml` the lines:
```
after_success:
- mvn clean test saga:coverage cobertura:cobertura coveralls:chain
```
### Complete plugin configuration
Configuration can be changed by the configuration section of plugin's definition in POM or with
Java virtual machine system properties using the syntax `-Dparameter=value`. See
[Maven plugin guide](http://maven.apache.org/guides/plugin/guide-java-plugin-development.html#Configuring_Parameters_in_a_Project)
how different types are mapped in the configuration XML. Some of the optional parameters are set
by the built-in service environment setups. Note that if a parameter is explicitly defined, the
service environment will not override it.
| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `coverallsFile` | `File` | **Default: ${project.build.directory}/coveralls.json**<br>File path to write and submit Coveralls data. |
| `coverallsUrl` | `String` | **Default: https://coveralls.io/api/v1/jobs**<br>Url for the Coveralls API. |
| `sourceDirectories` | `List<File>` | List of source directories. If not provided, the plugin will scan the project's compiled source roots. |
| `sourceUrls` | `List<URL>` | List of source urls. Can be used to load sources from external service, e.g. Jasmine server. |
| `sourceEncoding` | `String` | **Default: ${project.build.sourceEncoding}**<br>Source file encoding. |
| `serviceName` | `String` | CI service name. If not provided the supported service environments are used. |
| `serviceJobId` | `String` | CI service job id. Currently supported only with Travis CI. If this property is set, `repoToken` is not required. If not provided the supported service environments are used. |
| `serviceBuildNumber` | `String` | CI service build number. If not provided the supported service environments are used. |
| `serviceBuildUrl` | `String` | CI service build url. If not provided the supported service environments are used. |
| `serviceEnvironment` | `Properties` | CI service specific environment properties. If not provided the supported service environments are used. |
| `repoToken` | `String` | Coveralls repository token. **Do not publish this parameter unencrypted in public GitHub repositories.** |
| `branch` | `String` | Git branch name. If not provided the supported service environments are used. |
| `pullRequest` | `String` | GitHub pull request identifier. If not provided the supported service environments are used. |
| `timestamp` | `Date` | **Default: ${timestamp}**<br>Build timestamp. Must be in Maven supported 'yyyy-MM-dd HH:mm:ssa' format. |
| `dryRun` | `boolean` | **Default: false**<br>Dry run Coveralls report without actually sending it. |
| `coveralls.skip` | `boolean` | **Default: false**<br>Skip the plugin execution. |
| `coberturaFile` | `File` | **Default: ${project.reporting.outputDirectory}/cobertura/coverage.xml**<br>Only for `chain` goal. Cobertura report file. |
| `jacocoFile` | `File` | **Default: ${project.reporting.outputDirectory}/jacoco/jacoco.xml**<br>Only for `chain` goal. JaCoCo report file. |
| `sagaFile` | `File` | **Default: ${project.build.directory}/saga-coverage/total-coverage.xml**<br>Only for `chain` goal. Saga report file. |
### FAQ
> **Q:** How do I know that my coverage report was submitted successfully to Coveralls?
> **A:** The plugin will end with BUILD SUCCESS and the log contains the reported job id and
> direct URL to Coveralls.
<!-- -->
> **Q:** I get BUILD SUCCESS but why Coveralls shows only question marks in the reports?
> **A:** The data is most likely reported correctly, but Coveralls might take hours, or even a
> day, to update the actual coverage numbers.
<!-- -->
> **Q:** Build fails with 'javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated'
> exception, what to do?
> **A:** If the build is run with OpenJDK, you probably hit an issue with the Cryptography Package
> Providers not supporting all Elliptic Curves. The [issue](https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/1006776)
> is described in the Ubuntu issue tracker. A workaround is to disable the PKCS provider from the
> `java.security` options file.
> ```
> sudo sed -i 's/security.provider.9/#security.provider.9/g' $JAVA_HOME/jre/lib/security/java.security
> ```
> In Travis CI the above command can be added to before_install phase. See complete example from
> this project's `.travis.yml`.
<!-- -->
> **Q:** How can I use Scala or some other project which sources reside in other folder than
> `src/main/java`?
> **A:** The plugin uses all compiled source roots available for the project at runtime. If the
> source directories are available, everything is fine. Otherwise the used source directories can
> be changed with `sourceDirectories` configuration parameter that takes a Maven configuration
> style list of source directories.
<!-- -->
> **Q:** How can I set the plugin to use multiple source directories?
> **A:** For multi-module projects, the plugin automatically scans the project hierarchy and adds
> all required source directories. You can also customize the used source directories with
> `sourceDirectories` configuration parameter that takes a Maven configuration style list of
> source directories.
<!-- -->
> **Q:** Why source files are not found for generated sources?
> **A:** Generated source directories under target are not added to the sources list
> automatically. It is often not good practice to test generated code, because the code is not
> managed by the project under test, unless you are testing a source generator. Cobertura and
> JaCoCo both have `<excludes>` configuration directive that provides ignoring of class files. If
> the generated sources still must be tested, all source directories can be explicitly defined
> with `sourceDirectories` configuration parameter.
<!-- -->
> **Q:** JaCoCo or Cobertura, which one should i choose?
> **A:** For multi-module projects, only Cobertura supports report aggregation out of the box. The
> coverage metrics and performance of the two plugins are not much different for a small or medium
> sized project, but there are 2 notable differences with the tools:
> - JaCoCo does not track how many times a single line of code is hit by all the tests together,
> so Coveralls is always reported with 1 as the number of hits if the line is covered. Cobertura
> tracks the number of hits and the number is reported to Coveralls.
> - Cobertura tracks all inner classes separately, so a single source file will contain multiple
> records with same file name in Coveralls if there are any innner classes defined. The
> coveralls-maven-plugin adds classifier from the inner class to distinguish the files, but if
> there are lot of inner classes defined this creates some noise to the Coveralls reports. JaCoCo
> tracks inner classes within same source file so each source file is only reported once to
> Coveralls.
### Changelog
#### 2.2.0
- #31: Improved error messages for Coveralls API failures
- #30: Improved error message for missing charset
- #28: More lenient XML parsing
- #26, #29: Support for Saga coverage tool and chain multiple coverage reports
#### 2.1.0
- #24: Filter out remote names from git branches
- #19, #20: Skip configuration property to allow skipping of plugin execution
#### 2.0.1
- #18: Update to HttpComponents HttpClient 4.3
- #15, #16, #17: Disable PKCS cryptography provider at runtime to work around OpenJDK SSL issue
#### 2.0.0
- #13: Dry run property for test builds
- #12: Use ServiceSetup as secondary configuration source and Maven/VM properties as primary
- #11: Support multiple source directories
- #9: Support for other CI tools and platforms
- #8: Aggregated reports for multi-module projects
#### 1.2.0
- #10: Validation of the Coveralls job
- #4: Report build timestamp to Coveralls
- #3: Log code lines from generated report to Maven console
#### 1.1.0
- #1: Easier configuration for Travis CI
#### 1.0.0
- Initial release
### Migration guide
Changes marked with bold affect the plugin usage. Other changes are only related to development
and codebase.
#### 1.x to 2.x
- **`sourceDirectory` parameter removed and replaced with a list parameter `sourceDirectories`**
- **service environment parameters do not override configuration parameters**
- `org.eluder.coveralls.maven.plugin.service.ServiceSetup` interface completely changed to reflect
the service specific configuration properly
- `org.eluder.coveralls.maven.plugin.service.Travis` changed to reflect the new service setup
interface
- `org.eluder.coveralls.maven.plugin.domain.JobValidator` and all validation related code is
now located in `org.eluder.coveralls.maven.plugin.validation` package
- `org.eluder.coveralls.maven.plugin.domain.GitRepository` does not take custom branch parameter
as constructor argument anymore, the same behavior is handled with the new service environment
setup
- `org.eluder.coveralls.maven.plugin.domain.Job` has only default constructor and initialization
is done with _with*_ methods, _validate()_ method returns list of validation errors instead of
throwing exception
- `org.eluder.coveralls.maven.plugin.domain.SourceLoader` constructor takes a list of source
directories instead of a single source directory
### Credits
- Jakub Bednář (@bednar) for Saga integration and the idea of chaining multiple reports provided
by different coverage tools.
### Continuous integration
Travis CI builds the plugin with Oracle JDK 7. All successfully built snapshots are deployed to
Sonatype OSS repository. Cobertura is used to gather coverage metrics and the report is submitted
to Coveralls with this plugin.
### License
The project coveralls-maven-plugin is licensed under the MIT license.
================================================
FILE: pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eluder</groupId>
<artifactId>eluder-parent</artifactId>
<version>9</version>
</parent>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>4.4.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>coveralls-maven-plugin</name>
<description>Maven plugin for submitting Java code coverage reports to Coveralls web service.</description>
<url>https://github.com/trautonen/coveralls-maven-plugin</url>
<inceptionYear>2013</inceptionYear>
<developers>
<developer>
<name>Tapio Rautonen</name>
</developer>
</developers>
<licenses>
<license>
<name>The MIT License (MIT)</name>
<url>http://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<connection>scm:git:git://github.com/trautonen/coveralls-maven-plugin.git</connection>
<developerConnection>scm:git:git://github.com/trautonen/coveralls-maven-plugin.git</developerConnection>
<url>https://github.com/trautonen/coveralls-maven-plugin</url>
</scm>
<properties>
<java.version>1.8</java.version>
<httpclient.version>4.5.10</httpclient.version>
<jackson.version>2.10.0</jackson.version>
<jgit.version>4.5.0.201609210915-r</jgit.version>
<maven.version>3.5.4</maven.version>
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss'Z'</maven.build.timestamp.format>
<timestamp>${maven.build.timestamp}</timestamp>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.13</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.5.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock</artifactId>
<version>2.25.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>${httpclient.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>${jgit.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings-builder</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-repository-metadata</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model-builder</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.sonatype.sisu</groupId>
<artifactId>sisu-inject-plexus</artifactId>
<version>1.4.3.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>2.0.7</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.5.2</version>
<configuration>
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration>
<executions>
<execution>
<id>mojo-descriptor</id>
<goals>
<goal>descriptor</goal>
</goals>
</execution>
<execution>
<id>help-goal</id>
<goals>
<goal>helpmojo</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>${project.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>${maven.cobertura.version}</version>
<configuration>
<instrumentation>
<excludes>
<exclude>**/HelpMojo.class</exclude>
</excludes>
</instrumentation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<configuration>
<excludes>**/HelpMojo.java</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven.javadoc.version}</version>
<configuration>
<sourcepath>${project.basedir}/src/main/java</sourcepath>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>${maven.license.version}</version>
<configuration>
<excludes>
<exclude>**/cobertura.xml</exclude>
<exclude>**/jacoco1.xml</exclude>
<exclude>**/jacoco2.xml</exclude>
<exclude>**/SimpleCoverage.java</exclude>
<exclude>**/InnerClassCoverage.java</exclude>
<exclude>**/PartialCoverage.java</exclude>
<exclude>**/saga.xml</exclude>
<exclude>**/Components.js</exclude>
<exclude>**/Localization.js</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
================================================
FILE: sample/README.md
================================================
Coverage samples
================
### Cobertura
```
mvn -Pcobertura clean cobertura:cobertura
```
### JaCoCo
```
mvn -Pjacoco clean verify jacoco:report
```
### Saga
```
mvn -Psaga clean test saga:coverage
```
================================================
FILE: sample/module1/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>sample</artifactId>
<groupId>org.eluder.coverage</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>module1</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
</project>
================================================
FILE: sample/module1/src/main/java/org/eluder/coverage/sample/InnerClassCoverage.java
================================================
package org.eluder.coverage.sample;
public class InnerClassCoverage {
public void anonymous() {
InnerClass i = new InnerClass() {
@Override
public void run() {
System.out.println("overridden");
}
};
i.run();
}
public boolean delegate() {
return new InnerClass().isInner();
}
public static class InnerClass {
public boolean isInner() {
return true;
}
public void run() {
System.out.println("run");
}
}
}
================================================
FILE: sample/module1/src/main/java/org/eluder/coverage/sample/SimpleCoverage.java
================================================
package org.eluder.coverage.sample;
public class SimpleCoverage {
public boolean isTested() {
return false;
}
public void neverRun() {
System.out.println("oops");
}
}
================================================
FILE: sample/module1/src/main/resources/Components.js
================================================
(function() {
this.Components = {};
}).call(this);
================================================
FILE: sample/module1/src/main/resources/Localization.js
================================================
(function() {
var Localization;
Localization = (function() {
function Localization(values) {
this.values = values;
}
Localization.prototype.byKey = function(key) {
return this.values[key];
};
return Localization;
})();
}).call(this);
================================================
FILE: sample/module1/src/test/java/org/eluder/coverage/sample/InnerClassCoverageTest.java
================================================
package org.eluder.coverage.sample;
import org.junit.Test;
public class InnerClassCoverageTest {
@Test
public void testAnonymous() {
new InnerClassCoverage().anonymous();
}
@Test
public void testDelegate() {
new InnerClassCoverage().delegate();
}
}
================================================
FILE: sample/module1/src/test/java/org/eluder/coverage/sample/SimpleCoverageTest.java
================================================
package org.eluder.coverage.sample;
import org.junit.Test;
public class SimpleCoverageTest {
@Test
public void test() {
new SimpleCoverage().isTested();
}
}
================================================
FILE: sample/module1/src/test/specs/ComponentsSpec.coffee
================================================
describe 'Components testing', ->
it 'Components object on window not null', ->
expect(window.Components).not.toBe(null)
================================================
FILE: sample/module2/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>sample</artifactId>
<groupId>org.eluder.coverage</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>module2</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
</project>
================================================
FILE: sample/module2/src/main/java/org/eluder/coverage/sample/PartialCoverage.java
================================================
package org.eluder.coverage.sample;
public class PartialCoverage {
public void partial(boolean test) {
if (test) {
System.out.println("test");
} else {
System.out.println("not test");
}
}
}
================================================
FILE: sample/module2/src/test/java/org/eluder/coverage/sample/PartialCoverageIT.java
================================================
package org.eluder.coverage.sample;
import org.junit.Test;
public class PartialCoverageIT {
@Test
public void testSum() {
new PartialCoverage().partial(false);
}
}
================================================
FILE: sample/module2/src/test/java/org/eluder/coverage/sample/PartialCoverageTest.java
================================================
package org.eluder.coverage.sample;
import org.junit.Test;
public class PartialCoverageTest {
@Test
public void testPartial() {
new PartialCoverage().partial(true);
}
}
================================================
FILE: sample/pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eluder</groupId>
<artifactId>eluder-parent</artifactId>
<version>9</version>
<relativePath></relativePath>
</parent>
<groupId>org.eluder.coverage</groupId>
<artifactId>sample</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<prerequisites>
<maven>3.1.0</maven>
</prerequisites>
<properties>
<maven.jacoco.version>0.8.1</maven.jacoco.version>
<maven.cobertura.version>2.7</maven.cobertura.version>
<maven.jasmine.version>2.2</maven.jasmine.version>
<maven.saga.version>1.5.5</maven.saga.version>
</properties>
<modules>
<module>module1</module>
<module>module2</module>
</modules>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>4.3.0</version>
<configuration>
<sourceDirectories>
<sourceDirectory>module1/src/main/resources</sourceDirectory>
</sourceDirectories>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>cobertura</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>${maven.cobertura.version}</version>
<executions>
<execution>
<goals>
<goal>cobertura</goal>
</goals>
</execution>
</executions>
<configuration>
<aggregate>true</aggregate>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>jacoco</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${maven.jacoco.version}</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-prepare-agent-integration</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>default-report-integration</id>
<goals>
<goal>report-integration</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>saga</id>
<build>
<plugins>
<plugin>
<groupId>com.github.searls</groupId>
<artifactId>jasmine-maven-plugin</artifactId>
<version>${maven.jasmine.version}</version>
<executions>
<execution>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<jsSrcDir>${project.basedir}/src/main/resources/</jsSrcDir>
<jsTestSrcDir>${project.basedir}/src/test/specs</jsTestSrcDir>
<keepServerAlive>true</keepServerAlive>
<webDriverClassName>org.openqa.selenium.htmlunit.HtmlUnitDriver</webDriverClassName>
</configuration>
</plugin>
<plugin>
<groupId>com.github.timurstrekalov</groupId>
<artifactId>saga-maven-plugin</artifactId>
<version>${maven.saga.version}</version>
<executions>
<execution>
<goals>
<goal>coverage</goal>
</goals>
</execution>
</executions>
<configuration>
<baseDir>http://localhost:${jasmine.serverPort}</baseDir>
<outputDir>${project.build.directory}/saga-coverage</outputDir>
<noInstrumentPatterns>
<pattern>.*/spec/.*</pattern>
<pattern>.*/classpath/.*</pattern>
<pattern>.*/webjars/.*</pattern>
</noInstrumentPatterns>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
================================================
FILE: scripts/bump-version.sh
================================================
#!/bin/bash
if [ $# -ne 1 ]
then
echo "Invalid number of arguments"
echo "USAGE: $0 <version>"
exit 1
fi
version=$1
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
working_dir="$( pwd )"
files=( "pom.xml" "README.md" )
source $script_dir/functions.sh
if ! ( contains_files ${files[@]} )
then
working_dir=$working_dir/..
cd $working_dir
fi
if ! ( contains_files ${files[@]} )
then
echo "Some of the required files (${files[@]}) not found, aborting version bump"
exit 1
fi
echo "Updating version to $version in all poms"
mvn versions:set -DnewVersion=$version > /dev/null
mvn versions:commit > /dev/null
if [[ "$version" != *-SNAPSHOT ]]; then
echo "Replacing version numbers in readme"
sed -n -i '1h;1!H;${;g;s,<artifactId>coveralls-maven-plugin</artifactId>\n <version>[^<]*</version>,<artifactId>coveralls-maven-plugin</artifactId>\n <version>'"$version"'</version>,g;p;}' README.md
fi
echo "Committing version changes"
git add ${files[@]}
git commit -m "Updated to version $version."
================================================
FILE: scripts/functions.sh
================================================
#!/bin/bash
contains_files()
{
for file in "$@"
do
if ! [ -f $file ]
then
return 1
fi
done
return 0
}
================================================
FILE: scripts/release.sh
================================================
#!/bin/bash
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
working_dir="$( pwd )"
files=( "pom.xml" "README.md" )
source $script_dir/functions.sh
if ! ( contains_files ${files[@]} )
then
working_dir=$working_dir/..
cd $working_dir
fi
if ! ( contains_files ${files[@]} )
then
echo "Some of the required files (${files[@]}) not found, aborting release"
exit 1
fi
echo -n "Enter release version: "
read release_version
echo -n "Enter new development version: "
read develop_version
echo -n "Enter GPG passphrase: "
stty_orig=$(stty -g)
stty -echo
read passphrase
stty $stty_orig
echo "$passphrase" | gpg --passphrase-fd 0 --armor --output pom.xml.asc --detach-sig pom.xml > /dev/null
gpg --verify pom.xml.asc > /dev/null
if [ $? -ne 0 ]; then
echo "Seems that the GPG passphrase was invalid"
exit $?
fi
rm pom.xml.asc
echo ""
echo "Starting release process for $release_version"
echo "Working in $( pwd )"
echo "Press return to continue or CTRL-C to abort"
read
echo "Cleaning project"
mvn clean > /dev/null
echo "Updating license information"
mvn license:update-project-license license:update-file-header > /dev/null
git add -A
git commit -m "Updated license information."
$script_dir/bump-version.sh $release_version
echo "Creating tag for v$release_version"
git tag -a v$release_version -m "coveralls-maven-plugin version $release_version"
git checkout v$release_version
echo ""
echo "If everything went fine artifacts can be deployed to staging repository"
echo "After artifacts are deployed, login to https://oss.sonatype.org/ and complete the release"
echo "Press return to continue deploying or CTRL-C to abort"
read
mvn -Pprepare-deploy,prepare-release -Dgpg.passphrase=$passphrase clean deploy
echo ""
echo "Preparing for next development version $develop_version"
git checkout master
$script_dir/bump-version.sh $develop_version
echo ""
echo "Pushing everything to origin"
git push origin
git push origin --tags
echo ""
echo "Release completed for $release_version, current development version is $develop_version!"
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/CoverageParser.java
================================================
package org.eluder.coveralls.maven.plugin;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import java.io.File;
import java.io.IOException;
import org.eluder.coveralls.maven.plugin.source.SourceCallback;
/**
* Handles parsing of a coverage report. The implemenation can be statefull, and the same instance
* should be used only one time to parse a coverage report. Completed source files are passed to
* the {@link org.eluder.coveralls.maven.plugin.source.SourceCallback} handler. To maximize performance, the parser should use streaming.
*/
public interface CoverageParser {
/**
* Parses a coverage report. Parsed source files are passed to the callback handler. This
* method should be called only once per instance.
*
* @param callback the source callback handler
* @throws ProcessingException if processing of the coverage report fails
* @throws IOException if an I/O error occurs
*/
void parse(SourceCallback callback) throws ProcessingException, IOException;
/**
* @return the coverage report file under processing
*/
File getCoverageFile();
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/CoverallsReportMojo.java
================================================
package org.eluder.coveralls.maven.plugin;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.settings.Settings;
import org.eluder.coveralls.maven.plugin.domain.CoverallsResponse;
import org.eluder.coveralls.maven.plugin.domain.Git;
import org.eluder.coveralls.maven.plugin.domain.GitRepository;
import org.eluder.coveralls.maven.plugin.domain.Job;
import org.eluder.coveralls.maven.plugin.httpclient.CoverallsClient;
import org.eluder.coveralls.maven.plugin.httpclient.CoverallsProxyClient;
import org.eluder.coveralls.maven.plugin.json.JsonWriter;
import org.eluder.coveralls.maven.plugin.logging.CoverageTracingLogger;
import org.eluder.coveralls.maven.plugin.logging.DryRunLogger;
import org.eluder.coveralls.maven.plugin.logging.JobLogger;
import org.eluder.coveralls.maven.plugin.logging.Logger;
import org.eluder.coveralls.maven.plugin.logging.Logger.Position;
import org.eluder.coveralls.maven.plugin.service.Appveyor;
import org.eluder.coveralls.maven.plugin.service.Bamboo;
import org.eluder.coveralls.maven.plugin.service.Circle;
import org.eluder.coveralls.maven.plugin.service.General;
import org.eluder.coveralls.maven.plugin.service.Jenkins;
import org.eluder.coveralls.maven.plugin.service.ServiceSetup;
import org.eluder.coveralls.maven.plugin.service.Shippable;
import org.eluder.coveralls.maven.plugin.service.Travis;
import org.eluder.coveralls.maven.plugin.service.Wercker;
import org.eluder.coveralls.maven.plugin.source.SourceCallback;
import org.eluder.coveralls.maven.plugin.source.SourceLoader;
import org.eluder.coveralls.maven.plugin.source.UniqueSourceCallback;
import org.eluder.coveralls.maven.plugin.util.CoverageParsersFactory;
import org.eluder.coveralls.maven.plugin.util.SourceLoaderFactory;
import org.eluder.coveralls.maven.plugin.util.TimestampParser;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Properties;
@Mojo(name = "report", threadSafe = false, aggregator = true)
public class CoverallsReportMojo extends AbstractMojo {
/**
* File paths to additional JaCoCo coverage report files.
*/
@Parameter(property = "jacocoReports")
protected List<File> jacocoReports;
/**
* File paths to additional Cobertura coverage report files.
*/
@Parameter(property = "coberturaReports")
protected List<File> coberturaReports;
/**
* File paths to additional Saga coverage report files.
*/
@Parameter(property = "sagaReports")
protected List<File> sagaReports;
/**
* Directories for relative per module specific report files.
*/
@Parameter(property = "relativeReportDirs")
protected List<String> relativeReportDirs;
/**
* File path to write and submit Coveralls data.
*/
@Parameter(property = "coverallsFile", defaultValue = "${project.build.directory}/coveralls.json")
protected File coverallsFile;
/**
* Url for the Coveralls API.
*/
@Parameter(property = "coverallsUrl", defaultValue = "https://coveralls.io/api/v1/jobs")
protected String coverallsUrl;
/**
* Source directories.
*/
@Parameter(property = "sourceDirectories")
protected List<File> sourceDirectories;
/**
* Source file encoding.
*/
@Parameter(property = "sourceEncoding", defaultValue = "${project.build.sourceEncoding}")
protected String sourceEncoding;
/**
* CI service name.
*/
@Parameter(property = "serviceName")
protected String serviceName;
/**
* CI service job id.
*/
@Parameter(property = "serviceJobId")
protected String serviceJobId;
/**
* CI service build number.
*/
@Parameter(property = "serviceBuildNumber")
protected String serviceBuildNumber;
/**
* CI service build url.
*/
@Parameter(property = "serviceBuildUrl")
protected String serviceBuildUrl;
/**
* CI service specific environment properties.
*/
@Parameter(property = "serviceEnvironment")
protected Properties serviceEnvironment;
/**
* Coveralls repository token.
*/
@Parameter(property = "repoToken")
protected String repoToken;
/**
* Git branch name.
*/
@Parameter(property = "branch")
protected String branch;
/**
* GitHub pull request identifier.
*/
@Parameter(property = "pullRequest")
protected String pullRequest;
/**
* Coveralls parallel flag.
*/
@Parameter(property = "parallel")
protected boolean parallel;
/**
* Build timestamp format. Must be in format supported by SimpleDateFormat.
*/
@Parameter(property = "timestampFormat", defaultValue = "${maven.build.timestamp.format}")
protected String timestampFormat;
/**
* Build timestamp. Must be in format defined by 'timestampFormat' if it's available or in
* default timestamp format yyyy-MM-dd'T'HH:mm:ss'Z'.
*/
@Parameter(property = "timestamp", defaultValue = "${maven.build.timestamp}")
protected String timestamp;
/**
* Dry run Coveralls report without actually sending it.
*/
@Parameter(property = "dryRun", defaultValue = "false")
protected boolean dryRun;
/**
* Fail build if Coveralls service is not available or submission fails for internal errors.
*/
@Parameter(property = "failOnServiceError", defaultValue = "true")
protected boolean failOnServiceError;
/**
* Scan subdirectories for source files.
*/
@Parameter(property = "scanForSources", defaultValue = "false")
protected boolean scanForSources;
/**
* Base directory of the project.
*/
@Parameter(property = "coveralls.basedir", defaultValue = "${project.basedir}")
protected File basedir;
/**
* Skip the plugin execution.
*/
@Parameter(property = "coveralls.skip", defaultValue = "false")
protected boolean skip;
/**
* Maven settings.
*/
@Parameter(defaultValue = "${settings}", readonly = true, required = true)
protected Settings settings;
/**
* Maven project for runtime value resolution.
*/
@Component
protected MavenProject project;
@Override
public final void execute() throws MojoExecutionException, MojoFailureException {
if (skip) {
getLog().info("Skip property set, skipping plugin execution");
return;
}
try {
createEnvironment().setup();
Job job = createJob();
job.validate().throwOrInform(getLog());
SourceLoader sourceLoader = createSourceLoader(job);
List<CoverageParser> parsers = createCoverageParsers(sourceLoader);
JsonWriter writer = createJsonWriter(job);
CoverallsClient client = createCoverallsClient();
List<Logger> reporters = new ArrayList<>();
reporters.add(new JobLogger(job));
SourceCallback sourceCallback = createSourceCallbackChain(writer, reporters);
reporters.add(new DryRunLogger(job.isDryRun(), writer.getCoverallsFile()));
report(reporters, Position.BEFORE);
writeCoveralls(writer, sourceCallback, parsers);
report(reporters, Position.AFTER);
if (!job.isDryRun()) {
submitData(client, writer.getCoverallsFile());
}
} catch (ProcessingException ex) {
throw new MojoFailureException("Processing of input or output data failed", ex);
} catch (IOException ex) {
throw new MojoFailureException("I/O operation failed", ex);
} catch (Exception ex) {
throw new MojoExecutionException("Build error", ex);
}
}
/**
*
* @param sourceLoader source loader that extracts source files
* @return coverage parsers for all maven modules and additional reports
* @throws IOException if parsers cannot be created
*/
protected List<CoverageParser> createCoverageParsers(final SourceLoader sourceLoader) throws IOException {
return new CoverageParsersFactory(project, sourceLoader)
.withJaCoCoReports(jacocoReports)
.withCoberturaReports(coberturaReports)
.withSagaReports(sagaReports)
.withRelativeReportDirs(relativeReportDirs)
.createParsers();
}
/**
* @return source loader that extracts source files
*
* @param job the job describing the coveralls report
*/
protected SourceLoader createSourceLoader(final Job job) {
return new SourceLoaderFactory(job.getGit().getBaseDir(), project, sourceEncoding)
.withSourceDirectories(sourceDirectories)
.withScanForSources(scanForSources)
.createSourceLoader();
}
/**
* @return environment to setup mojo and service specific properties
*/
protected Environment createEnvironment() {
return new Environment(this, getServices());
}
/**
* @return list of available continuous integration services
*/
protected List<ServiceSetup> getServices() {
Map<String, String> env = System.getenv();
List<ServiceSetup> services = new ArrayList<>();
services.add(new Shippable(env));
services.add(new Travis(env));
services.add(new Circle(env));
services.add(new Jenkins(env));
services.add(new Bamboo(env));
services.add(new Appveyor(env));
services.add(new Wercker(env));
services.add(new General(env));
return services;
}
/**
* @return job that describes the coveralls report
* @throws ProcessingException if processing of timestamp fails
* @throws IOException if an I/O error occurs
*/
protected Job createJob() throws ProcessingException, IOException {
Git git = new GitRepository(basedir).load();
Date time = new TimestampParser(timestampFormat).parse(timestamp);
return new Job()
.withRepoToken(repoToken)
.withServiceName(serviceName)
.withServiceJobId(serviceJobId)
.withServiceBuildNumber(serviceBuildNumber)
.withServiceBuildUrl(serviceBuildUrl)
.withParallel(parallel)
.withServiceEnvironment(serviceEnvironment)
.withDryRun(dryRun)
.withBranch(branch)
.withPullRequest(pullRequest)
.withTimestamp(time)
.withGit(git);
}
/**
* @param job the job describing the coveralls report
* @return JSON writer that writes the coveralls data
* @throws IOException if an I/O error occurs
*/
protected JsonWriter createJsonWriter(final Job job) throws IOException {
return new JsonWriter(job, coverallsFile);
}
/**
* @return http client that submits the coveralls data
*/
protected CoverallsClient createCoverallsClient() {
return new CoverallsProxyClient(coverallsUrl, settings.getActiveProxy());
}
/**
* @param writer the JSON writer
* @param reporters the logging reporters
* @return source callback chain for different source handlers
*/
protected SourceCallback createSourceCallbackChain(final JsonWriter writer, final List<Logger> reporters) {
SourceCallback chain = writer;
if (getLog().isInfoEnabled()) {
CoverageTracingLogger coverageTracingReporter = new CoverageTracingLogger(chain);
chain = coverageTracingReporter;
reporters.add(coverageTracingReporter);
}
chain = new UniqueSourceCallback(chain);
return chain;
}
/**
* Writes coverage data to JSON file.
*
* @param writer JSON writer that writes the coveralls data
* @param sourceCallback the source callback handler
* @param parsers list of coverage parsers
* @throws ProcessingException if process to to create JSON file fails
* @throws IOException if an I/O error occurs
*/
protected void writeCoveralls(final JsonWriter writer, final SourceCallback sourceCallback, final List<CoverageParser> parsers) throws ProcessingException, IOException {
try {
getLog().info("Writing Coveralls data to " + writer.getCoverallsFile().getAbsolutePath() + "...");
long now = System.currentTimeMillis();
sourceCallback.onBegin();
for (CoverageParser parser : parsers) {
getLog().info("Processing coverage report from " + parser.getCoverageFile().getAbsolutePath());
parser.parse(sourceCallback);
}
sourceCallback.onComplete();
long duration = System.currentTimeMillis() - now;
getLog().info("Successfully wrote Coveralls data in " + duration + "ms");
} finally {
writer.close();
}
}
private void submitData(final CoverallsClient client, final File coverallsFile) throws ProcessingException, IOException {
getLog().info("Submitting Coveralls data to API");
long now = System.currentTimeMillis();
try {
CoverallsResponse response = client.submit(coverallsFile);
long duration = System.currentTimeMillis() - now;
getLog().info("Successfully submitted Coveralls data in " + duration + "ms for " + response.getMessage());
getLog().info(response.getUrl());
getLog().info("*** It might take hours for Coveralls to update the actual coverage numbers for a job");
getLog().info(" If you see question marks in the report, please be patient");
} catch (ProcessingException ex) {
long duration = System.currentTimeMillis() - now;
String message = "Submission failed in " + duration + "ms while processing data";
handleSubmissionError(ex, message, true);
} catch (IOException ex) {
long duration = System.currentTimeMillis() - now;
String message = "Submission failed in " + duration + "ms while handling I/O operations";
handleSubmissionError(ex, message, failOnServiceError);
}
}
private <T extends Exception> void handleSubmissionError(final T ex, final String message, final boolean failOnException) throws T {
if (failOnException) {
getLog().error(message);
throw ex;
} else {
getLog().warn(message);
}
}
private void report(final List<Logger> reporters, final Position position) {
for (Logger reporter : reporters) {
if (position.equals(reporter.getPosition())) {
reporter.log(getLog());
}
}
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/Environment.java
================================================
package org.eluder.coveralls.maven.plugin;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import java.util.Properties;
import org.codehaus.plexus.util.StringUtils;
import org.eluder.coveralls.maven.plugin.service.ServiceSetup;
/**
* Constructs and setups the project environment and continuous integration service.
*/
public final class Environment {
private final CoverallsReportMojo mojo;
private final Iterable<ServiceSetup> services;
public Environment(final CoverallsReportMojo mojo, final Iterable<ServiceSetup> services) {
if (mojo == null) {
throw new IllegalArgumentException("mojo must be defined");
}
if (services == null) {
throw new IllegalArgumentException("services must be defined");
}
this.mojo = mojo;
this.services = services;
}
public void setup() {
setupService();
verify();
}
private void verify() {
if (mojo.sourceEncoding == null) {
throw new IllegalArgumentException("Source encoding not set, use <sourceEncoding> configuration option or set project wide property <project.build.sourceEncoding>");
}
}
private void setupService() {
for (ServiceSetup service : services) {
if (service.isSelected()) {
setupEnvironment(service);
break;
}
}
}
private void setupEnvironment(final ServiceSetup service) {
String name = service.getName();
if (StringUtils.isBlank(mojo.serviceName) && StringUtils.isNotBlank(name)) {
mojo.serviceName = name;
}
String jobId = service.getJobId();
if (StringUtils.isBlank(mojo.serviceJobId) && StringUtils.isNotBlank(jobId)) {
mojo.serviceJobId = jobId;
}
String buildNumber = service.getBuildNumber();
if (StringUtils.isBlank(mojo.serviceBuildNumber) && StringUtils.isNotBlank(buildNumber)) {
mojo.serviceBuildNumber = buildNumber;
}
String buildUrl = service.getBuildUrl();
if (StringUtils.isBlank(mojo.serviceBuildUrl) && StringUtils.isNotBlank(buildUrl)) {
mojo.serviceBuildUrl = buildUrl;
}
String branch = service.getBranch();
if (StringUtils.isBlank(mojo.branch) && StringUtils.isNotBlank(branch)) {
mojo.branch = branch;
}
String pullRequest = service.getPullRequest();
if (StringUtils.isBlank(mojo.pullRequest) && StringUtils.isNotBlank(pullRequest)) {
mojo.pullRequest = pullRequest;
}
Properties environment = service.getEnvironment();
if ((mojo.serviceEnvironment == null || mojo.serviceEnvironment.isEmpty()) &&
(environment != null && !environment.isEmpty())) {
mojo.serviceEnvironment = environment;
}
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/ProcessingException.java
================================================
package org.eluder.coveralls.maven.plugin;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
/**
* Exception to indicate if processing of input or output data fails.
*/
public class ProcessingException extends Exception {
public ProcessingException() {
super();
}
public ProcessingException(final String message) {
super(message);
}
public ProcessingException(final Throwable cause) {
super(cause);
}
public ProcessingException(final String message, final Throwable cause) {
super(message, cause);
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/domain/Branch.java
================================================
package org.eluder.coveralls.maven.plugin.domain;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
public class Branch {
private final int lineNumber;
private final int blockNumber;
private final int branchNumber;
private final int hits;
public Branch(final int lineNumber,
final int blockNumber,
final int branchNumber,
final int hits) {
this.lineNumber = lineNumber;
this.blockNumber = blockNumber;
this.branchNumber = branchNumber;
this.hits = hits;
}
public int getLineNumber() {
return lineNumber;
}
public int getBlockNumber() {
return blockNumber;
}
public int getBranchNumber() {
return branchNumber;
}
public int getHits() {
return hits;
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/domain/CoverallsResponse.java
================================================
package org.eluder.coveralls.maven.plugin.domain;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public final class CoverallsResponse implements JsonObject {
private final String message;
private final boolean error;
private final String url;
@JsonCreator
public CoverallsResponse(
@JsonProperty("message") final String message,
@JsonProperty("error") final boolean error,
@JsonProperty("url") final String url) {
this.message = message;
this.error = error;
this.url = url;
}
public String getMessage() {
return message;
}
public boolean isError() {
return error;
}
public String getUrl() {
return url;
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/domain/Git.java
================================================
package org.eluder.coveralls.maven.plugin.domain;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import java.io.File;
import java.io.Serializable;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Git implements JsonObject {
@JsonIgnore
private final File baseDir;
@JsonProperty("head")
private final Head head;
@JsonProperty("branch")
private final String branch;
@JsonProperty("remotes")
private final List<Remote> remotes;
public Git(final File baseDir, final Head head, final String branch, final List<Remote> remotes) {
this.baseDir = baseDir;
this.head = head;
this.branch = branch;
this.remotes = remotes;
}
public File getBaseDir() {
return baseDir;
}
public Head getHead() {
return head;
}
public String getBranch() {
return branch;
}
public List<Remote> getRemotes() {
return remotes;
}
public static class Head implements Serializable {
@JsonProperty("id")
private final String id;
@JsonProperty("author_name")
private final String authorName;
@JsonProperty("author_email")
private final String authorEmail;
@JsonProperty("committer_name")
private final String committerName;
@JsonProperty("committer_email")
private final String committerEmail;
@JsonProperty("message")
private final String message;
public Head(final String id, final String authorName, final String authorEmail, final String committerName, final String committerEmail, final String message) {
this.id = id;
this.authorName = authorName;
this.authorEmail = authorEmail;
this.committerName = committerName;
this.committerEmail = committerEmail;
this.message = message;
}
public String getId() {
return id;
}
public String getAuthorName() {
return authorName;
}
public String getAuthorEmail() {
return authorEmail;
}
public String getCommitterName() {
return committerName;
}
public String getCommitterEmail() {
return committerEmail;
}
public String getMessage() {
return message;
}
}
public static class Remote implements Serializable {
@JsonProperty("name")
private final String name;
@JsonProperty("url")
private final String url;
public Remote(final String name, final String url) {
this.name = name;
this.url = url;
}
public String getName() {
return name;
}
public String getUrl() {
return url;
}
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/domain/GitRepository.java
================================================
package org.eluder.coveralls.maven.plugin.domain;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.lib.RepositoryBuilder;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevWalk;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class GitRepository {
private final File sourceDirectory;
public GitRepository(final File sourceDirectory) {
this.sourceDirectory = sourceDirectory;
}
public Git load() throws IOException {
try (Repository repository = new RepositoryBuilder().findGitDir(this.sourceDirectory).build()) {
Git.Head head = getHead(repository);
String branch = getBranch(repository);
List<Git.Remote> remotes = getRemotes(repository);
return new Git(repository.getWorkTree(), head, branch, remotes);
}
}
private Git.Head getHead(final Repository repository) throws IOException {
ObjectId revision = repository.resolve(Constants.HEAD);
RevCommit commit = new RevWalk(repository).parseCommit(revision);
Git.Head head = new Git.Head(
revision.getName(),
commit.getAuthorIdent().getName(),
commit.getAuthorIdent().getEmailAddress(),
commit.getCommitterIdent().getName(),
commit.getCommitterIdent().getEmailAddress(),
commit.getFullMessage()
);
return head;
}
private String getBranch(final Repository repository) throws IOException {
return repository.getBranch();
}
private List<Git.Remote> getRemotes(final Repository repository) {
Config config = repository.getConfig();
List<Git.Remote> remotes = new ArrayList<>();
for (String remote : config.getSubsections("remote")) {
String url = config.getString("remote", remote, "url");
remotes.add(new Git.Remote(remote, url));
}
return remotes;
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/domain/Job.java
================================================
package org.eluder.coveralls.maven.plugin.domain;
import java.util.Date;
import java.util.Properties;
import org.eluder.coveralls.maven.plugin.domain.Git.Remote;
import org.eluder.coveralls.maven.plugin.validation.JobValidator;
import org.eluder.coveralls.maven.plugin.validation.ValidationErrors;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
public class Job {
private String repoToken;
private String serviceName;
private String serviceJobId;
private String serviceBuildNumber;
private String serviceBuildUrl;
private boolean parallel;
private Properties serviceEnvironment;
private Date timestamp;
private boolean dryRun;
private String branch;
private String pullRequest;
private Git git;
public Job() {
// noop
}
public Job withRepoToken(final String repoToken) {
this.repoToken = repoToken;
return this;
}
public Job withServiceName(final String serviceName) {
this.serviceName = serviceName;
return this;
}
public Job withServiceJobId(final String serviceJobId) {
this.serviceJobId = serviceJobId;
return this;
}
public Job withServiceBuildNumber(final String serviceBuildNumber) {
this.serviceBuildNumber = serviceBuildNumber;
return this;
}
public Job withServiceBuildUrl(final String serviceBuildUrl) {
this.serviceBuildUrl = serviceBuildUrl;
return this;
}
public Job withParallel(final boolean parallel) {
this.parallel = parallel;
return this;
}
public Job withServiceEnvironment(final Properties serviceEnvironment) {
this.serviceEnvironment = serviceEnvironment;
return this;
}
public Job withTimestamp(final Date timestamp) {
this.timestamp = timestamp;
return this;
}
public Job withDryRun(final boolean dryRun) {
this.dryRun = dryRun;
return this;
}
public Job withBranch(final String branch) {
this.branch = branch;
return this;
}
public Job withPullRequest(final String pullRequest) {
this.pullRequest = pullRequest;
return this;
}
public Job withGit(final Git git) {
this.git = git;
return this;
}
public String getRepoToken() {
return repoToken;
}
public String getServiceName() {
return serviceName;
}
public String getServiceJobId() {
return serviceJobId;
}
public String getServiceBuildNumber() {
return serviceBuildNumber;
}
public String getServiceBuildUrl() {
return serviceBuildUrl;
}
public Properties getServiceEnvironment() {
return serviceEnvironment;
}
public Date getTimestamp() {
return timestamp;
}
public boolean isParallel() {
return parallel;
}
public boolean isDryRun() {
return dryRun;
}
public String getBranch() {
if (branch != null && getGit() != null && getGit().getRemotes() != null) {
for (Remote remote : getGit().getRemotes()) {
if (branch.startsWith(remote.getName() + "/")) {
return branch.substring(remote.getName().length() + 1);
}
}
}
return branch;
}
public String getPullRequest() {
return pullRequest;
}
public Git getGit() {
return git;
}
public ValidationErrors validate() {
JobValidator validator = new JobValidator(this);
return validator.validate();
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/domain/JsonObject.java
================================================
package org.eluder.coveralls.maven.plugin.domain;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(Include.NON_NULL)
public interface JsonObject extends Serializable {
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/domain/Source.java
================================================
package org.eluder.coveralls.maven.plugin.domain;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.ListIterator;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public final class Source implements JsonObject {
private static final Pattern NEWLINE = Pattern.compile("\r\n|\r|\n");
//private static final String CLASSIFIER_SEPARATOR = "#";
private final String name;
private final String digest;
private final Integer[] coverage;
private final List<Branch> branches;
private String classifier;
public Source(final String name, final String source, final String digest) {
this(name, getLines(source), digest, null);
}
protected Source(final String name, final int lines, final String digest, final String classifier) {
this.name = name;
this.digest = digest;
this.coverage = new Integer[lines];
this.classifier = classifier;
this.branches = new ArrayList<>();
}
@JsonIgnore
public String getName() {
return name;
}
@JsonProperty("name")
public String getFullName() {
return name;
// #45: cannot use identifier due to unfetchable source files
//return (classifier == null ? name : name + CLASSIFIER_SEPARATOR + classifier);
}
@JsonProperty("source_digest")
public String getDigest() {
return digest;
}
@JsonProperty("coverage")
public Integer[] getCoverage() {
return coverage;
}
@JsonProperty("branches")
public Integer[] getBranches() {
final List<Integer> branchesRaw = new ArrayList<>(branches.size() * 4);
for (final Branch b : branches) {
branchesRaw.add(b.getLineNumber());
branchesRaw.add(b.getBlockNumber());
branchesRaw.add(b.getBranchNumber());
branchesRaw.add(b.getHits());
}
return branchesRaw.toArray(new Integer[branchesRaw.size()]);
}
public List<Branch> getBranchesList() {
return Collections.unmodifiableList(branches);
}
@JsonIgnore
public String getClassifier() {
return classifier;
}
public void setClassifier(final String classifier) {
this.classifier = classifier;
}
private void checkLineRange(final int lineNumber) {
int index = lineNumber - 1;
if (index >= this.coverage.length) {
throw new IllegalArgumentException("Line number " + lineNumber + " is greater than the source file " + name + " size");
}
}
public void addCoverage(final int lineNumber, final Integer coverage) {
checkLineRange(lineNumber);
this.coverage[lineNumber - 1] = coverage;
}
public void addBranchCoverage(final int lineNumber,
final int blockNumber,
final int branchNumber,
final int hits) {
addBranchCoverage(false, lineNumber, blockNumber, branchNumber, hits);
}
private void addBranchCoverage(final boolean merge,
final int lineNumber,
final int blockNumber,
final int branchNumber,
final int hits) {
checkLineRange(lineNumber);
int hitSum = hits;
final ListIterator<Branch> it = this.branches.listIterator();
while (it.hasNext()) {
final Branch b = it.next();
if (b.getLineNumber() == lineNumber &&
b.getBlockNumber() == blockNumber &&
b.getBranchNumber() == branchNumber) {
it.remove();
if (merge) {
hitSum += b.getHits();
}
}
}
this.branches.add(new Branch(lineNumber, blockNumber, branchNumber, hitSum));
}
public Source merge(final Source source) {
Source copy = new Source(this.name, this.coverage.length, this.digest, this.classifier);
System.arraycopy(this.coverage, 0, copy.coverage, 0, this.coverage.length);
copy.branches.addAll(this.branches);
if (copy.equals(source)) {
for (int i = 0; i < copy.coverage.length; i++) {
if (source.coverage[i] != null) {
int base = copy.coverage[i] != null ? copy.coverage[i] : 0;
copy.coverage[i] = base + source.coverage[i];
}
}
for (final Branch b : source.branches) {
copy.addBranchCoverage(true,
b.getLineNumber(),
b.getBlockNumber(),
b.getBranchNumber(),
b.getHits());
}
}
return copy;
}
@Override
public boolean equals(final Object obj) {
if (!(obj instanceof Source)) {
return false;
}
Source other = (Source) obj;
return (Objects.equals(this.name, other.name) &&
Objects.equals(this.digest, other.digest) &&
Objects.equals(this.coverage.length, other.coverage.length));
}
@Override
public int hashCode() {
return Objects.hash(this.name, this.digest, this.coverage.length);
}
private static int getLines(final String source) {
int lines = 1;
Matcher matcher = NEWLINE.matcher(source);
while (matcher.find()) {
lines++;
}
return lines;
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/httpclient/CoverallsClient.java
================================================
package org.eluder.coveralls.maven.plugin.httpclient;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.HttpMultipartMode;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.StringUtils;
import org.eluder.coveralls.maven.plugin.ProcessingException;
import org.eluder.coveralls.maven.plugin.domain.CoverallsResponse;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.security.Provider;
import java.security.Security;
public class CoverallsClient {
static {
for (Provider provider : Security.getProviders()) {
if (provider.getName().startsWith("SunPKCS11")) {
Security.removeProvider(provider.getName());
}
}
}
private static final String FILE_NAME = "coveralls.json";
private static final ContentType MIME_TYPE = ContentType.create("application/octet-stream", "utf-8");
private final String coverallsUrl;
private final HttpClient httpClient;
private final ObjectMapper objectMapper;
public CoverallsClient(final String coverallsUrl) {
this(coverallsUrl, new HttpClientFactory(coverallsUrl).create(), new ObjectMapper());
}
public CoverallsClient(final String coverallsUrl, final HttpClient httpClient, final ObjectMapper objectMapper) {
this.coverallsUrl = coverallsUrl;
this.httpClient = httpClient;
this.objectMapper = objectMapper;
}
public CoverallsResponse submit(final File file) throws ProcessingException, IOException {
HttpEntity entity = MultipartEntityBuilder.create()
.setMode(HttpMultipartMode.BROWSER_COMPATIBLE)
.addBinaryBody("json_file", file, MIME_TYPE, FILE_NAME)
.build();
HttpPost post = new HttpPost(coverallsUrl);
post.setEntity(entity);
HttpResponse response = httpClient.execute(post);
return parseResponse(response);
}
private CoverallsResponse parseResponse(final HttpResponse response) throws ProcessingException, IOException {
HttpEntity entity = response.getEntity();
ContentType contentType = ContentType.getOrDefault(entity);
if (contentType.getCharset() == null) {
throw new ProcessingException(getResponseErrorMessage(response, "Response doesn't contain Content-Type header"));
}
InputStreamReader reader = null;
try {
if (response.getStatusLine().getStatusCode() >= HttpStatus.SC_INTERNAL_SERVER_ERROR) {
throw new IOException("Coveralls API internal error");
}
reader = new InputStreamReader(entity.getContent(), contentType.getCharset());
CoverallsResponse cr = objectMapper.readValue(reader, CoverallsResponse.class);
if (cr.isError()) {
throw new ProcessingException(getResponseErrorMessage(response, cr.getMessage()));
}
return cr;
} catch (JsonProcessingException ex) {
throw new ProcessingException(getResponseErrorMessage(response, ex.getMessage()), ex);
} catch (IOException ex) {
throw new IOException(getResponseErrorMessage(response, ex.getMessage()), ex);
} finally {
IOUtil.close(reader);
}
}
private String getResponseErrorMessage(final HttpResponse response, final String message) {
int status = response.getStatusLine().getStatusCode();
String reason = response.getStatusLine().getReasonPhrase();
String errorMessage = "Report submission to Coveralls API failed with HTTP status " + status + ":";
if (StringUtils.isNotBlank(reason)) {
errorMessage += " " + reason;
}
if (StringUtils.isNotBlank(message)) {
errorMessage += " (" + message + ")";
}
return errorMessage;
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/httpclient/CoverallsProxyClient.java
================================================
package org.eluder.coveralls.maven.plugin.httpclient;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.maven.settings.Proxy;
public class CoverallsProxyClient extends CoverallsClient {
public CoverallsProxyClient(final String coverallsUrl, final Proxy proxy) {
super(coverallsUrl, new HttpClientFactory(coverallsUrl).proxy(proxy).create(), new ObjectMapper());
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/httpclient/HttpClientFactory.java
================================================
package org.eluder.coveralls.maven.plugin.httpclient;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.maven.settings.Proxy;
import org.codehaus.plexus.util.StringUtils;
import org.eluder.coveralls.maven.plugin.util.UrlUtils;
import org.eluder.coveralls.maven.plugin.util.Wildcards;
class HttpClientFactory {
private static final int DEFAULT_CONNECTION_TIMEOUT = 10000;
private static final int DEFAULT_SOCKET_TIMEOUT = 60000;
private final String targetUrl;
private final HttpClientBuilder hcb = HttpClientBuilder.create();
private final RequestConfig.Builder rcb = RequestConfig.custom()
.setConnectTimeout(DEFAULT_CONNECTION_TIMEOUT)
.setSocketTimeout(DEFAULT_SOCKET_TIMEOUT);
HttpClientFactory(final String targetUrl) {
this.targetUrl = targetUrl;
}
public HttpClientFactory proxy(final Proxy proxy) {
if (proxy != null && isProxied(targetUrl, proxy)) {
rcb.setProxy(new HttpHost(proxy.getHost(), proxy.getPort(), proxy.getProtocol()));
if (StringUtils.isNotBlank(proxy.getUsername())) {
CredentialsProvider cp = new BasicCredentialsProvider();
cp.setCredentials(
new AuthScope(proxy.getHost(), proxy.getPort()),
new UsernamePasswordCredentials(proxy.getUsername(), proxy.getPassword())
);
hcb.setDefaultCredentialsProvider(cp);
}
}
return this;
}
public HttpClient create() {
return hcb.setDefaultRequestConfig(rcb.build()).build();
}
private boolean isProxied(final String url, final Proxy proxy) {
if (StringUtils.isNotBlank(proxy.getNonProxyHosts())) {
String host = UrlUtils.create(url).getHost();
String[] excludes = proxy.getNonProxyHosts().split("\\|");
for (String exclude : excludes) {
if (StringUtils.isNotBlank(exclude) && Wildcards.matches(host, exclude.trim())) {
return false;
}
}
}
return true;
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/json/JsonWriter.java
================================================
package org.eluder.coveralls.maven.plugin.json;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import com.fasterxml.jackson.core.JsonEncoding;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.MappingJsonFactory;
import org.codehaus.plexus.util.StringUtils;
import org.eluder.coveralls.maven.plugin.ProcessingException;
import org.eluder.coveralls.maven.plugin.domain.Job;
import org.eluder.coveralls.maven.plugin.domain.Source;
import org.eluder.coveralls.maven.plugin.source.SourceCallback;
import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map.Entry;
import java.util.Properties;
public class JsonWriter implements SourceCallback, Closeable {
protected static final String TIMESTAMP_FORMAT = "yyyy-MM-dd HH:mm:ss Z";
private final Job job;
private final File coverallsFile;
private final JsonGenerator generator;
public JsonWriter(final Job job, final File coverallsFile) throws IOException {
File directory = coverallsFile.getParentFile();
if (!directory.exists()) {
directory.mkdirs();
}
this.job = job;
this.coverallsFile = coverallsFile;
this.generator = new MappingJsonFactory().createGenerator(coverallsFile, JsonEncoding.UTF8);
}
public final Job getJob() {
return job;
}
public final File getCoverallsFile() {
return coverallsFile;
}
@Override
public void onBegin() throws ProcessingException, IOException {
try {
generator.writeStartObject();
writeOptionalString("repo_token", job.getRepoToken());
writeOptionalString("service_name", job.getServiceName());
writeOptionalString("service_job_id", job.getServiceJobId());
writeOptionalString("service_number", job.getServiceBuildNumber());
writeOptionalString("service_build_url", job.getServiceBuildUrl());
writeOptionalString("service_branch", job.getBranch());
writeOptionalString("service_pull_request", job.getPullRequest());
writeOptionalBoolean("parallel", job.isParallel());
writeOptionalTimestamp("run_at", job.getTimestamp());
writeOptionalEnvironment("environment", job.getServiceEnvironment());
writeOptionalObject("git", job.getGit());
generator.writeArrayFieldStart("source_files");
} catch (JsonProcessingException ex) {
throw new ProcessingException(ex);
}
}
@Override
public void onSource(final Source source) throws ProcessingException, IOException {
try {
generator.writeObject(source);
} catch (JsonProcessingException ex) {
throw new ProcessingException(ex);
}
}
@Override
public void onComplete() throws ProcessingException, IOException {
try {
generator.writeEndArray();
generator.writeEndObject();
} catch (JsonProcessingException ex) {
throw new ProcessingException(ex);
}
}
@Override
public void close() throws IOException {
generator.close();
}
private void writeOptionalString(final String field, final String value) throws ProcessingException, IOException {
if (StringUtils.isNotBlank(value)) {
generator.writeStringField(field, value);
}
}
private void writeOptionalBoolean(final String field, final boolean value) throws ProcessingException, IOException {
if (value) {
generator.writeBooleanField(field, value);
}
}
private void writeOptionalObject(final String field, final Object value) throws ProcessingException, IOException {
if (value != null) {
generator.writeObjectField(field, value);
}
}
private void writeOptionalTimestamp(final String field, final Date value) throws ProcessingException, IOException {
if (value != null) {
SimpleDateFormat format = new SimpleDateFormat(TIMESTAMP_FORMAT);
writeOptionalString(field, format.format(value));
}
}
private void writeOptionalEnvironment(final String field, final Properties properties) throws ProcessingException, IOException {
if (properties != null) {
generator.writeObjectFieldStart(field);
for (Entry<Object, Object> property : properties.entrySet()) {
writeOptionalString(property.getKey().toString(), property.getValue().toString());
}
generator.writeEndObject();
}
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/logging/CoverageTracingLogger.java
================================================
package org.eluder.coveralls.maven.plugin.logging;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import org.apache.maven.plugin.logging.Log;
import org.eluder.coveralls.maven.plugin.ProcessingException;
import org.eluder.coveralls.maven.plugin.domain.Branch;
import org.eluder.coveralls.maven.plugin.domain.Source;
import org.eluder.coveralls.maven.plugin.source.ChainingSourceCallback;
import org.eluder.coveralls.maven.plugin.source.SourceCallback;
import java.io.IOException;
public class CoverageTracingLogger extends ChainingSourceCallback implements Logger {
private long files = 0;
private long lines = 0;
private long relevant = 0;
private long covered = 0;
private long branches = 0;
private long coveredBranches = 0;
public CoverageTracingLogger(final SourceCallback chained) {
super(chained);
}
public long getFiles() {
return files;
}
public final long getLines() {
return lines;
}
public final long getRelevant() {
return relevant;
}
public final long getCovered() {
return covered;
}
public final long getMissed() {
return relevant - covered;
}
public final long getBranches() {
return branches;
}
public final long getCoveredBranches() {
return coveredBranches;
}
public final long getMissedBranches() {
return branches - coveredBranches;
}
@Override
public Position getPosition() {
return Position.AFTER;
}
@Override
public void log(final Log log) {
log.info("Gathered code coverage metrics for " + getFiles() + " source files with " + getLines() + " lines of code:");
log.info("- " + getRelevant() + " relevant lines");
log.info("- " + getCovered() + " covered lines");
log.info("- " + getMissed() + " missed lines");
log.info("- " + getBranches() + " branches");
log.info("- " + getCoveredBranches() + " covered branches");
log.info("- " + getMissedBranches() + " missed branches");
}
@Override
protected void onSourceInternal(final Source source) throws ProcessingException, IOException {
files++;
lines += source.getCoverage().length;
for (Integer coverage : source.getCoverage()) {
if (coverage != null) {
relevant++;
if (coverage > 0) {
covered++;
}
}
}
this.branches += source.getBranchesList().size();
for (final Branch b : source.getBranchesList()) {
if (b.getHits() > 0) {
coveredBranches++;
}
}
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/logging/DryRunLogger.java
================================================
package org.eluder.coveralls.maven.plugin.logging;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import java.io.File;
import org.apache.maven.plugin.logging.Log;
public class DryRunLogger implements Logger {
private final boolean dryRun;
private final File coverallsFile;
public DryRunLogger(final boolean dryRun, final File coverallsFile) {
if (coverallsFile == null) {
throw new IllegalArgumentException("coverallsFile must be defined");
}
this.dryRun = dryRun;
this.coverallsFile = coverallsFile;
}
@Override
public Position getPosition() {
return Position.AFTER;
}
@Override
public void log(final Log log) {
if (dryRun) {
log.info("Dry run enabled, Coveralls report will NOT be submitted to API");
log.info(coverallsFile.length() + " bytes of data was recorded in " + coverallsFile.getAbsolutePath());
}
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/logging/JobLogger.java
================================================
package org.eluder.coveralls.maven.plugin.logging;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import org.apache.maven.plugin.logging.Log;
import org.eluder.coveralls.maven.plugin.domain.Job;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
public class JobLogger implements Logger {
private static final int ABBREV = 7;
private final Job job;
private final ObjectMapper jsonMapper;
public JobLogger(final Job job) {
this(job, null);
}
public JobLogger(final Job job, final ObjectMapper jsonMapper) {
if (job == null) {
throw new IllegalArgumentException("job must be defined");
}
this.job = job;
this.jsonMapper = (jsonMapper != null ? jsonMapper : createDefaultJsonMapper());
}
@Override
public Position getPosition() {
return Position.BEFORE;
}
@Override
public void log(final Log log) {
StringBuilder starting = new StringBuilder("Starting Coveralls job");
if (job.getServiceName() != null) {
starting.append(" for " + job.getServiceName());
if (job.getServiceJobId() != null) {
starting.append(" (" + job.getServiceJobId() + ")");
} else if (job.getServiceBuildNumber() != null) {
starting.append(" (" + job.getServiceBuildNumber());
if (job.getServiceBuildUrl() != null) {
starting.append(" / " + job.getServiceBuildUrl());
}
starting.append(")");
}
}
if (job.isDryRun()) {
starting.append(" in dry run mode");
}
if (job.isParallel()) {
starting.append(" with parallel option enabled");
}
log.info(starting.toString());
if (job.getRepoToken() != null) {
log.info("Using repository token <secret>");
}
if (job.getGit() != null) {
String commit = job.getGit().getHead().getId();
String branch = (job.getBranch() != null ? job.getBranch() : job.getGit().getBranch());
log.info("Git commit " + commit.substring(0, ABBREV) + " in " + branch);
}
if (log.isDebugEnabled()) {
try {
log.debug("Complete Job description:\n" + jsonMapper.writeValueAsString(job));
} catch (JsonProcessingException ex) {
throw new RuntimeException(ex);
}
}
}
private ObjectMapper createDefaultJsonMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true);
mapper.configure(SerializationFeature.INDENT_OUTPUT, true);
mapper.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true);
return mapper;
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/logging/Logger.java
================================================
package org.eluder.coveralls.maven.plugin.logging;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import org.apache.maven.plugin.logging.Log;
public interface Logger {
/**
* Position of the log output.
*/
enum Position {
BEFORE, AFTER
}
/**
* @return the position for log output, before or after the Coveralls data writing
*/
Position getPosition();
/**
* Create the log output.
*
* @param log the logger to output
*/
void log(Log log);
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/parser/AbstractXmlEventParser.java
================================================
package org.eluder.coveralls.maven.plugin.parser;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.ReaderFactory;
import org.codehaus.plexus.util.xml.XmlStreamReader;
import org.eluder.coveralls.maven.plugin.CoverageParser;
import org.eluder.coveralls.maven.plugin.ProcessingException;
import org.eluder.coveralls.maven.plugin.domain.Source;
import org.eluder.coveralls.maven.plugin.source.SourceCallback;
import org.eluder.coveralls.maven.plugin.source.SourceLoader;
import javax.xml.stream.FactoryConfigurationError;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import java.io.File;
import java.io.IOException;
import java.io.Reader;
public abstract class AbstractXmlEventParser implements CoverageParser {
private final File coverageFile;
private final SourceLoader sourceLoader;
public AbstractXmlEventParser(final File coverageFile, final SourceLoader sourceLoader) {
this.coverageFile = coverageFile;
this.sourceLoader = sourceLoader;
}
@Override
public final void parse(final SourceCallback callback) throws ProcessingException, IOException {
XmlStreamReader reader = ReaderFactory.newXmlReader(coverageFile);
XMLStreamReader xml = createEventReader(reader);
try {
while (xml.hasNext()) {
xml.next();
onEvent(xml, callback);
}
} catch (XMLStreamException ex) {
throw new ProcessingException(ex);
} finally {
close(xml);
IOUtil.close(reader);
}
}
@Override
public final File getCoverageFile() {
return coverageFile;
}
protected XMLStreamReader createEventReader(final Reader reader) throws ProcessingException {
try {
XMLInputFactory xmlif = XMLInputFactory.newInstance();
xmlif.setProperty(XMLInputFactory.SUPPORT_DTD, false);
xmlif.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, false);
xmlif.setProperty(XMLInputFactory.IS_VALIDATING, false);
return xmlif.createXMLStreamReader(reader);
} catch (FactoryConfigurationError ex) {
throw new IllegalArgumentException(ex);
} catch (XMLStreamException ex) {
throw new ProcessingException(ex);
}
}
private void close(final XMLStreamReader xml) throws ProcessingException {
if (xml != null) {
try {
xml.close();
} catch (XMLStreamException ex) {
throw new ProcessingException(ex);
}
}
}
protected abstract void onEvent(final XMLStreamReader xml, SourceCallback callback) throws XMLStreamException, ProcessingException, IOException;
protected final Source loadSource(final String sourceFile) throws IOException {
return sourceLoader.load(sourceFile);
}
protected final boolean isStartElement(final XMLStreamReader xml, final String name) {
return (XMLStreamConstants.START_ELEMENT == xml.getEventType() && xml.getLocalName().equals(name));
}
protected final boolean isEndElement(final XMLStreamReader xml, final String name) {
return (XMLStreamConstants.END_ELEMENT == xml.getEventType() && xml.getLocalName().equals(name));
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/parser/CoberturaParser.java
================================================
package org.eluder.coveralls.maven.plugin.parser;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import java.io.File;
import java.io.IOException;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import org.eluder.coveralls.maven.plugin.ProcessingException;
import org.eluder.coveralls.maven.plugin.domain.Source;
import org.eluder.coveralls.maven.plugin.source.SourceCallback;
import org.eluder.coveralls.maven.plugin.source.SourceLoader;
public class CoberturaParser extends AbstractXmlEventParser {
protected Source source;
protected boolean inMethods;
private int branchId;
public CoberturaParser(final File coverageFile, final SourceLoader sourceLoader) {
super(coverageFile, sourceLoader);
}
@Override
protected void onEvent(final XMLStreamReader xml, final SourceCallback callback) throws XMLStreamException, ProcessingException, IOException {
if (isStartElement(xml, "class")) {
source = loadSource(xml.getAttributeValue(null, "filename"));
String className = xml.getAttributeValue(null, "name");
int classifierPosition = className.indexOf('$');
if (classifierPosition > 0) {
source.setClassifier(className.substring(classifierPosition + 1));
}
this.branchId = 0;
} else
if (isStartElement(xml, "methods") && source != null) {
inMethods = true;
} else
if (isEndElement(xml, "methods") && source != null) {
inMethods = false;
} else
if (isStartElement(xml, "line") && !inMethods && source != null) {
final int nr = Integer.parseInt(xml.getAttributeValue(null, "number"));
source.addCoverage(nr, Integer.valueOf(xml.getAttributeValue(null, "hits")));
if (Boolean.parseBoolean(xml.getAttributeValue(null, "branch"))) {
final String value = xml.getAttributeValue(null, "condition-coverage");
// Is "condition-coverage" attribute always here?
if (value == null) {
return;
}
// C'mon Cobertura, human readable format for XML ?
final String[] values = value // 50% (2/4)
.replace(" ", "") // 50%(2/4)
.replace("%", "/") // 50/(2/4)
.replace("(", "") // 50/2/4)
.replace(")", "") // 50/2/4
.split("/");
final int cb = Integer.parseInt(values[1]);
final int tb = Integer.parseInt(values[2]);
final int mb = tb - cb;
// add branches. unfortunately, there is NO block number and
// branch number will NOT be unique between coverage changes.
for (int b = 0; b < cb; b++) {
this.source.addBranchCoverage(nr, 0, this.branchId++, 1);
}
for (int b = 0; b < mb; b++) {
this.source.addBranchCoverage(nr, 0, this.branchId++, 0);
}
}
} else
if (isEndElement(xml, "class") && source != null) {
callback.onSource(source);
source = null;
}
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/parser/JaCoCoParser.java
================================================
package org.eluder.coveralls.maven.plugin.parser;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import java.io.File;
import java.io.IOException;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import org.eluder.coveralls.maven.plugin.ProcessingException;
import org.eluder.coveralls.maven.plugin.domain.Source;
import org.eluder.coveralls.maven.plugin.source.SourceCallback;
import org.eluder.coveralls.maven.plugin.source.SourceLoader;
public class JaCoCoParser extends AbstractXmlEventParser {
private String packageName;
private Source source;
private int branchId;
public JaCoCoParser(final File coverageFile, final SourceLoader sourceLoader) {
super(coverageFile, sourceLoader);
}
@Override
protected void onEvent(final XMLStreamReader xml, final SourceCallback callback) throws XMLStreamException, ProcessingException, IOException {
if (isStartElement(xml, "package")) {
this.packageName = xml.getAttributeValue(null, "name");
} else
if (isStartElement(xml, "sourcefile") && packageName != null) {
String sourceFile = this.packageName + "/" + xml.getAttributeValue(null, "name");
this.source = loadSource(sourceFile);
this.branchId = 0;
} else
if (isStartElement(xml, "line") && this.source != null) {
int ci = Integer.parseInt(xml.getAttributeValue(null, "ci"));
int cb = Integer.parseInt(xml.getAttributeValue(null, "cb"));
int mb = Integer.parseInt(xml.getAttributeValue(null, "mb"));
int nr = Integer.parseInt(xml.getAttributeValue(null, "nr"));
// jacoco does not count hits. this is why hits is always 0 or 1
this.source.addCoverage(nr, (ci == 0 ? 0 : 1));
// add branches. unfortunately, there is NO block number and
// branch number will NOT be unique between coverage changes.
for (int b = 0; b < cb; b++) {
this.source.addBranchCoverage(nr, 0, this.branchId++, 1);
}
for (int b = 0; b < mb; b++) {
this.source.addBranchCoverage(nr, 0, this.branchId++, 0);
}
} else
if (isEndElement(xml, "sourcefile") && this.source != null) {
callback.onSource(this.source);
this.source = null;
} else
if (isEndElement(xml, "package")) {
this.packageName = null;
}
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/parser/SagaParser.java
================================================
package org.eluder.coveralls.maven.plugin.parser;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import java.io.File;
import java.io.IOException;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import org.eluder.coveralls.maven.plugin.ProcessingException;
import org.eluder.coveralls.maven.plugin.source.SourceCallback;
import org.eluder.coveralls.maven.plugin.source.SourceLoader;
/**
* @author Jakub Bednář (25/12/2013 10:07)
*/
public class SagaParser extends CoberturaParser {
public SagaParser(final File coverageFile, final SourceLoader sourceLoader) {
super(coverageFile, sourceLoader);
}
@Override
protected void onEvent(final XMLStreamReader xml, final SourceCallback callback) throws XMLStreamException, ProcessingException, IOException {
if (isStartElement(xml, "class")) {
String name = xml.getAttributeValue(null, "name");
source = loadSource(name);
} else {
super.onEvent(xml, callback);
}
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/service/AbstractServiceSetup.java
================================================
package org.eluder.coveralls.maven.plugin.service;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import java.util.Map;
import java.util.Properties;
import org.codehaus.plexus.util.StringUtils;
/**
* Convenient base class for service setups.
*/
public abstract class AbstractServiceSetup implements ServiceSetup {
private final Map<String, String> env;
public AbstractServiceSetup(final Map<String, String> env) {
this.env = env;
}
@Override
public String getJobId() {
return null;
}
@Override
public String getBuildNumber() {
return null;
}
@Override
public String getBuildUrl() {
return null;
}
@Override
public String getBranch() {
return null;
}
@Override
public String getPullRequest() {
return null;
}
@Override
public Properties getEnvironment() {
return null;
}
protected final String getProperty(final String name) {
return env.get(name);
}
protected final void addProperty(final Properties properties, final String name, final String value) {
if (StringUtils.isBlank(name)) {
throw new IllegalArgumentException("name must be defined");
}
if (StringUtils.isNotBlank(value)) {
properties.setProperty(name, value);
}
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/service/Appveyor.java
================================================
package org.eluder.coveralls.maven.plugin.service;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import java.util.Map;
/**
* Service implementation for Appveyor.
* <p>
* http://appveyor.com/
*/
public class Appveyor extends AbstractServiceSetup {
public static final String APPVEYOR_NAME = "Appveyor";
public static final String APPVEYOR = "APPVEYOR";
public static final String APPVEYOR_BUILD_NUMBER = "APPVEYOR_BUILD_NUMBER";
public static final String APPVEYOR_BUILD_ID = "APPVEYOR_BUILD_ID";
public static final String APPVEYOR_BRANCH = "APPVEYOR_REPO_BRANCH";
public static final String APPVEYOR_COMMIT = "APPVEYOR_REPO_COMMIT";
public static final String APPVEYOR_PULL_REQUEST = "APPVEYOR_PULL_REQUEST_NUMBER";
public static final String APPVEYOR_REPO_NAME = "APPVEYOR_REPO_NAME";
public Appveyor(final Map<String, String> env) {
super(env);
}
@Override
public boolean isSelected() {
return ("true".equalsIgnoreCase(getProperty(APPVEYOR)));
}
@Override
public String getName() {
return APPVEYOR_NAME;
}
@Override
public String getBuildNumber() {
return getProperty(APPVEYOR_BUILD_NUMBER);
}
@Override
public String getBuildUrl() {
return "https://ci.appveyor.com/project/" + getProperty(APPVEYOR_REPO_NAME) + "/build/" + getProperty(APPVEYOR_BUILD_NUMBER);
}
@Override
public String getBranch() {
return getProperty(APPVEYOR_BRANCH);
}
@Override
public String getPullRequest() {
return getProperty(APPVEYOR_PULL_REQUEST);
}
@Override
public String getJobId() {
return getProperty(APPVEYOR_BUILD_ID);
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/service/Bamboo.java
================================================
package org.eluder.coveralls.maven.plugin.service;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import java.util.Map;
/**
* Service implementation for Atlassian Bamboo.
* <p>
* https://www.atlassian.com/software/bamboo/
*/
public class Bamboo extends AbstractServiceSetup {
public static final String BAMBOO_NAME = "bamboo";
public static final String BAMBOO_BUILD_NUMBER = "bamboo.buildNumber";
public static final String BAMBOO_BUILD_URL = "bamboo.buildResultsUrl";
public static final String BAMBOO_BRANCH = "bamboo.repository.git.branch";
public Bamboo(final Map<String, String> env) {
super(env);
}
@Override
public boolean isSelected() {
return (getProperty(BAMBOO_BUILD_NUMBER) != null);
}
@Override
public String getName() {
return BAMBOO_NAME;
}
@Override
public String getBuildNumber() {
return getProperty(BAMBOO_BUILD_NUMBER);
}
@Override
public String getBuildUrl() {
return getProperty(BAMBOO_BUILD_URL);
}
@Override
public String getBranch() {
return getProperty(BAMBOO_BRANCH);
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/service/Circle.java
================================================
package org.eluder.coveralls.maven.plugin.service;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import java.util.Map;
import java.util.Properties;
/**
* Service implementation for CircleCI.
* <p>
* https://circleci.com/
*/
public class Circle extends AbstractServiceSetup {
public static final String CIRCLE_NAME = "circleci";
public static final String CIRCLE = "CIRCLECI";
public static final String CIRCLE_BUILD_NUMBER = "CIRCLE_BUILD_NUM";
public static final String CIRCLE_BRANCH = "CIRCLE_BRANCH";
public static final String CIRCLE_COMMIT = "CIRCLE_SHA1";
public Circle(final Map<String, String> env) {
super(env);
}
@Override
public boolean isSelected() {
return (getProperty(CIRCLE) != null);
}
@Override
public String getName() {
return CIRCLE_NAME;
}
@Override
public String getBuildNumber() {
return getProperty(CIRCLE_BUILD_NUMBER);
}
@Override
public String getBranch() {
return getProperty(CIRCLE_BRANCH);
}
@Override
public Properties getEnvironment() {
Properties environment = new Properties();
addProperty(environment, "circleci_build_num", getProperty(CIRCLE_BUILD_NUMBER));
addProperty(environment, "branch", getProperty(CIRCLE_BRANCH));
addProperty(environment, "commit_sha", getProperty(CIRCLE_COMMIT));
return environment;
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/service/General.java
================================================
package org.eluder.coveralls.maven.plugin.service;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import java.util.Map;
/**
* General implementation for any continuous integration service that provides the required
* environment properties.
*/
public class General extends AbstractServiceSetup {
public static final String CI_NAME = "CI_NAME";
public static final String CI_BUILD_NUMBER = "CI_BUILD_NUMBER";
public static final String CI_BUILD_URL = "CI_BUILD_URL";
public static final String CI_BRANCH = "CI_BRANCH";
public static final String CI_PULL_REQUEST = "CI_PULL_REQUEST";
public General(final Map<String, String> env) {
super(env);
}
@Override
public boolean isSelected() {
return (getProperty(CI_NAME) != null);
}
@Override
public String getName() {
return getProperty(CI_NAME);
}
@Override
public String getBuildNumber() {
return getProperty(CI_BUILD_NUMBER);
}
@Override
public String getBuildUrl() {
return getProperty(CI_BUILD_URL);
}
@Override
public String getBranch() {
return getProperty(CI_BRANCH);
}
@Override
public String getPullRequest() {
return getProperty(CI_PULL_REQUEST);
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/service/Jenkins.java
================================================
package org.eluder.coveralls.maven.plugin.service;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import java.util.Map;
import java.util.Properties;
/**
* Service implementation for Jenkins.
* <p>
* http://jenkins-ci.org/
*/
public class Jenkins extends AbstractServiceSetup {
public static final String JENKINS_NAME = "jenkins";
public static final String JENKINS_URL = "JENKINS_URL";
public static final String JENKINS_BUILD_NUMBER = "BUILD_NUMBER";
public static final String JENKINS_BUILD_URL = "BUILD_URL";
public static final String JENKINS_BRANCH = "GIT_BRANCH";
public static final String JENKINS_COMMIT = "GIT_COMMIT";
public Jenkins(final Map<String, String> env) {
super(env);
}
@Override
public boolean isSelected() {
return (getProperty(JENKINS_URL) != null);
}
@Override
public String getName() {
return JENKINS_NAME;
}
@Override
public String getBuildNumber() {
return getProperty(JENKINS_BUILD_NUMBER);
}
@Override
public String getBuildUrl() {
return getProperty(JENKINS_BUILD_URL);
}
@Override
public String getBranch() {
return getProperty(JENKINS_BRANCH);
}
@Override
public Properties getEnvironment() {
Properties environment = new Properties();
addProperty(environment, "jenkins_build_num", getProperty(JENKINS_BUILD_NUMBER));
addProperty(environment, "jenkins_build_url", getProperty(JENKINS_BUILD_URL));
addProperty(environment, "branch", getProperty(JENKINS_BRANCH));
addProperty(environment, "commit_sha", getProperty(JENKINS_COMMIT));
return environment;
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/service/ServiceSetup.java
================================================
package org.eluder.coveralls.maven.plugin.service;
import java.util.Properties;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
/**
* Service specific mojo properties.
*/
public interface ServiceSetup {
/**
* @return <code>true</code> if this service is selected, otherwise <code>false</code>
*/
boolean isSelected();
/**
* @return service name
*/
String getName();
/**
* @return service job id, or <code>null</code> if not defined
*/
String getJobId();
/**
* @return service build number, or <code>null</code> if not defined
*/
String getBuildNumber();
/**
* @return service build url, or <code>null</code> if not defined
*/
String getBuildUrl();
/**
* @return git branch name, or <code>null</code> if not defined
*/
String getBranch();
/**
* @return pull request identifier, or <code>null</code> if not defined
*/
String getPullRequest();
/**
* @return environment related to service, or <code>null</code> if not defined
*/
Properties getEnvironment();
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/service/Shippable.java
================================================
package org.eluder.coveralls.maven.plugin.service;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import java.util.Map;
import java.util.Properties;
/**
* Service implementation for Shippable.
* <p>
* http://shippable.com/
*/
public class Shippable extends AbstractServiceSetup {
public static final String SHIPPABLE_NAME = "shippable";
public static final String SHIPPABLE = "SHIPPABLE";
public static final String SHIPPABLE_BUILD_NUMBER = "SHIPPABLE_BUILD_NUMBER";
public static final String SHIPPABLE_BUILD_ID = "SHIPPABLE_BUILD_ID";
public static final String SHIPPABLE_BRANCH = "BRANCH";
public static final String SHIPPABLE_COMMIT = "COMMIT";
public static final String SHIPPABLE_PULL_REQUEST = "PULL_REQUEST";
public Shippable(final Map<String, String> env) {
super(env);
}
@Override
public boolean isSelected() {
return ("true".equalsIgnoreCase(getProperty(SHIPPABLE)));
}
@Override
public String getName() {
return SHIPPABLE_NAME;
}
@Override
public String getBuildNumber() {
return getProperty(SHIPPABLE_BUILD_NUMBER);
}
@Override
public String getBuildUrl() {
return "https://app.shippable.com/builds/" + getProperty(SHIPPABLE_BUILD_ID);
}
@Override
public String getBranch() {
return getProperty(SHIPPABLE_BRANCH);
}
@Override
public String getPullRequest() {
String pullRequest = getProperty(SHIPPABLE_PULL_REQUEST);
if ("false".equals(pullRequest)) {
return null;
}
return pullRequest;
}
@Override
public Properties getEnvironment() {
Properties environment = new Properties();
addProperty(environment, "shippable_build_number", getProperty(SHIPPABLE_BUILD_NUMBER));
addProperty(environment, "shippable_build_id", getProperty(SHIPPABLE_BUILD_ID));
addProperty(environment, "shippable_build_url", getBuildUrl());
addProperty(environment, "branch", getProperty(SHIPPABLE_BRANCH));
addProperty(environment, "commit_sha", getProperty(SHIPPABLE_COMMIT));
return environment;
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/service/Travis.java
================================================
package org.eluder.coveralls.maven.plugin.service;
import java.util.Map;
import java.util.Properties;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
/**
* Service implementation for Travis CI.
* <p>
* https://travis-ci.org/
*/
public class Travis extends AbstractServiceSetup {
public static final String TRAVIS_NAME = "travis-ci";
public static final String TRAVIS = "TRAVIS";
public static final String TRAVIS_JOB_ID = "TRAVIS_JOB_ID";
public static final String TRAVIS_BRANCH = "TRAVIS_BRANCH";
public static final String TRAVIS_PULL_REQUEST = "TRAVIS_PULL_REQUEST";
public Travis(final Map<String, String> env) {
super(env);
}
@Override
public boolean isSelected() {
return ("true".equalsIgnoreCase(getProperty(TRAVIS)));
}
@Override
public String getName() {
return TRAVIS_NAME;
}
@Override
public String getJobId() {
return getProperty(TRAVIS_JOB_ID);
}
@Override
public String getBranch() {
return getProperty(TRAVIS_BRANCH);
}
@Override
public String getPullRequest() {
return getProperty(TRAVIS_PULL_REQUEST);
}
@Override
public Properties getEnvironment() {
Properties environment = new Properties();
addProperty(environment, "travis_job_id", getProperty(TRAVIS_JOB_ID));
addProperty(environment, "travis_pull_request", getProperty(TRAVIS_PULL_REQUEST));
return environment;
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/service/Wercker.java
================================================
package org.eluder.coveralls.maven.plugin.service;
import java.util.Map;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
/**
* Service implementation for Wercker CI.
* <p>
* http://wercker.com/
*/
public class Wercker extends AbstractServiceSetup {
public static final String WERCKER_NAME = "wercker";
public static final String WERCKER = "WERCKER";
public static final String WERCKER_BUILD_ID = "WERCKER_BUILD_ID";
public static final String WERCKER_BUILD_URL = "WERCKER_BUILD_URL";
public static final String WERCKER_BRANCH = "WERCKER_GIT_BRANCH";
public Wercker(final Map<String, String> env) {
super(env);
}
@Override
public boolean isSelected() {
return "true".equalsIgnoreCase(getProperty(WERCKER));
}
@Override
public String getName() {
return WERCKER_NAME;
}
@Override
public String getJobId() {
return getProperty(WERCKER_BUILD_ID);
}
@Override
public String getBuildUrl() {
return getProperty(WERCKER_BUILD_URL);
}
@Override
public String getBranch() {
return getProperty(WERCKER_BRANCH);
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/source/AbstractSourceLoader.java
================================================
package org.eluder.coveralls.maven.plugin.source;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import org.codehaus.plexus.util.IOUtil;
import org.eluder.coveralls.maven.plugin.domain.Source;
import org.eluder.coveralls.maven.plugin.util.Md5DigestInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URI;
import java.nio.charset.Charset;
import java.security.NoSuchAlgorithmException;
public abstract class AbstractSourceLoader implements SourceLoader {
private final Charset sourceEncoding;
private final String directoryPrefix;
public AbstractSourceLoader(final URI base, final URI sourceBase, final String sourceEncoding) {
this.sourceEncoding = Charset.forName(sourceEncoding);
this.directoryPrefix = base.relativize(sourceBase).toString();
}
@Override
public Source load(final String sourceFile) throws IOException {
InputStream stream = locate(sourceFile);
if (stream != null) {
try (Md5DigestInputStream ds = new Md5DigestInputStream(stream);
InputStreamReader reader = new InputStreamReader(ds, getSourceEncoding())) {
String source = IOUtil.toString(reader);
return new Source(getFileName(sourceFile), source, ds.getDigestHex());
} catch (NoSuchAlgorithmException ex) {
throw new IOException("MD5 algorithm not available", ex);
}
} else {
return null;
}
}
protected Charset getSourceEncoding() {
return sourceEncoding;
}
protected String getFileName(final String sourceFile) {
return directoryPrefix + sourceFile;
}
protected abstract InputStream locate(String sourceFile) throws IOException;
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/source/ChainingSourceCallback.java
================================================
package org.eluder.coveralls.maven.plugin.source;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import org.eluder.coveralls.maven.plugin.ProcessingException;
import org.eluder.coveralls.maven.plugin.domain.Source;
import java.io.IOException;
/**
* Source callback handler that allows chaining multiple callback handlers. Chained callback
* handler is executed after this callback.
*/
public abstract class ChainingSourceCallback implements SourceCallback {
private final SourceCallback chained;
public ChainingSourceCallback(final SourceCallback chained) {
if (chained == null) {
throw new IllegalArgumentException("chained must be defined");
}
this.chained = chained;
}
@Override
public final void onBegin() throws ProcessingException, IOException {
onBeginInternal();
chained.onBegin();
}
@Override
public final void onSource(final Source source) throws ProcessingException, IOException {
onSourceInternal(source);
chained.onSource(source);
}
@Override
public final void onComplete() throws ProcessingException, IOException {
onCompleteInternal();
chained.onComplete();
}
/**
* Defaults to no-op implementation.
*
* @see #onBegin()
*
* @throws ProcessingException if processing fails
* @throws IOException if an I/O error occurs
*/
protected void onBeginInternal() throws ProcessingException, IOException {
}
/**
* @see #onSource(Source)
*
* @param source the source file
* @throws ProcessingException if further processing of the source fails
* @throws IOException if an I/O error occurs
*/
protected abstract void onSourceInternal(final Source source) throws ProcessingException, IOException;
/**
* Defaults to no-op implementation.
*
* @see #onComplete()
*
* @throws ProcessingException if processing fails
* @throws IOException if an I/O error occurs
*/
protected void onCompleteInternal() throws ProcessingException, IOException {
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/source/DirectorySourceLoader.java
================================================
package org.eluder.coveralls.maven.plugin.source;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
* %[license]
*/
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
public class DirectorySourceLoader extends AbstractSourceLoader {
private final File sourceDirectory;
public DirectorySourceLoader(final File base, final File sourceDirectory, final String sourceEncoding) {
super(base.toURI(), sourceDirectory.toURI(), sourceEncoding);
this.sourceDirectory = sourceDirectory;
}
@Override
protected InputStream locate(final String sourceFile) throws IOException {
File file = new File(sourceDirectory, sourceFile);
if (file.exists()) {
if (!file.isFile()) {
throw new IllegalArgumentException(file.getAbsolutePath() + " is not file");
}
return new BufferedInputStream(new FileInputStream(file));
}
return null;
}
}
================================================
FILE: src/main/java/org/eluder/coveralls/maven/plugin/source/MultiSourceLoader.java
================================================
package org.eluder.coveralls.maven.plugin.source;
/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2016 Tapio Rautonen
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permis
gitextract_4r5n4qdh/
├── .gitignore
├── .gitmodules
├── .travis.yml
├── CHANGELOG.md
├── LICENSE.MIT
├── MIGRATION.md
├── README.md
├── README_2_x.md
├── pom.xml
├── sample/
│ ├── README.md
│ ├── module1/
│ │ ├── pom.xml
│ │ └── src/
│ │ ├── main/
│ │ │ ├── java/
│ │ │ │ └── org/
│ │ │ │ └── eluder/
│ │ │ │ └── coverage/
│ │ │ │ └── sample/
│ │ │ │ ├── InnerClassCoverage.java
│ │ │ │ └── SimpleCoverage.java
│ │ │ └── resources/
│ │ │ ├── Components.js
│ │ │ └── Localization.js
│ │ └── test/
│ │ ├── java/
│ │ │ └── org/
│ │ │ └── eluder/
│ │ │ └── coverage/
│ │ │ └── sample/
│ │ │ ├── InnerClassCoverageTest.java
│ │ │ └── SimpleCoverageTest.java
│ │ └── specs/
│ │ └── ComponentsSpec.coffee
│ ├── module2/
│ │ ├── pom.xml
│ │ └── src/
│ │ ├── main/
│ │ │ └── java/
│ │ │ └── org/
│ │ │ └── eluder/
│ │ │ └── coverage/
│ │ │ └── sample/
│ │ │ └── PartialCoverage.java
│ │ └── test/
│ │ └── java/
│ │ └── org/
│ │ └── eluder/
│ │ └── coverage/
│ │ └── sample/
│ │ ├── PartialCoverageIT.java
│ │ └── PartialCoverageTest.java
│ └── pom.xml
├── scripts/
│ ├── bump-version.sh
│ ├── functions.sh
│ └── release.sh
└── src/
├── main/
│ └── java/
│ └── org/
│ └── eluder/
│ └── coveralls/
│ └── maven/
│ └── plugin/
│ ├── CoverageParser.java
│ ├── CoverallsReportMojo.java
│ ├── Environment.java
│ ├── ProcessingException.java
│ ├── domain/
│ │ ├── Branch.java
│ │ ├── CoverallsResponse.java
│ │ ├── Git.java
│ │ ├── GitRepository.java
│ │ ├── Job.java
│ │ ├── JsonObject.java
│ │ └── Source.java
│ ├── httpclient/
│ │ ├── CoverallsClient.java
│ │ ├── CoverallsProxyClient.java
│ │ └── HttpClientFactory.java
│ ├── json/
│ │ └── JsonWriter.java
│ ├── logging/
│ │ ├── CoverageTracingLogger.java
│ │ ├── DryRunLogger.java
│ │ ├── JobLogger.java
│ │ └── Logger.java
│ ├── parser/
│ │ ├── AbstractXmlEventParser.java
│ │ ├── CoberturaParser.java
│ │ ├── JaCoCoParser.java
│ │ └── SagaParser.java
│ ├── service/
│ │ ├── AbstractServiceSetup.java
│ │ ├── Appveyor.java
│ │ ├── Bamboo.java
│ │ ├── Circle.java
│ │ ├── General.java
│ │ ├── Jenkins.java
│ │ ├── ServiceSetup.java
│ │ ├── Shippable.java
│ │ ├── Travis.java
│ │ └── Wercker.java
│ ├── source/
│ │ ├── AbstractSourceLoader.java
│ │ ├── ChainingSourceCallback.java
│ │ ├── DirectorySourceLoader.java
│ │ ├── MultiSourceLoader.java
│ │ ├── ScanSourceLoader.java
│ │ ├── SourceCallback.java
│ │ ├── SourceLoader.java
│ │ ├── UniqueSourceCallback.java
│ │ └── UrlSourceLoader.java
│ ├── util/
│ │ ├── CoverageParsersFactory.java
│ │ ├── ExistingFiles.java
│ │ ├── MavenProjectCollector.java
│ │ ├── Md5DigestInputStream.java
│ │ ├── SourceLoaderFactory.java
│ │ ├── TimestampParser.java
│ │ ├── UrlUtils.java
│ │ └── Wildcards.java
│ └── validation/
│ ├── JobValidator.java
│ ├── ValidationError.java
│ ├── ValidationErrors.java
│ └── ValidationException.java
└── test/
├── java/
│ └── org/
│ └── eluder/
│ └── coveralls/
│ └── maven/
│ └── plugin/
│ ├── CoverageFixture.java
│ ├── CoverallsReportMojoTest.java
│ ├── EnvironmentTest.java
│ ├── ProcessingExceptionTest.java
│ ├── domain/
│ │ ├── GitRepositoryTest.java
│ │ ├── JobTest.java
│ │ └── SourceTest.java
│ ├── httpclient/
│ │ ├── CoverallsClientTest.java
│ │ ├── CoverallsProxyClientTest.java
│ │ └── HttpClientFactoryTest.java
│ ├── json/
│ │ └── JsonWriterTest.java
│ ├── logging/
│ │ ├── CoverageTracingLoggerTest.java
│ │ ├── DryRunLoggerTest.java
│ │ └── JobLoggerTest.java
│ ├── parser/
│ │ ├── AbstractCoverageParserTest.java
│ │ ├── CoberturaParserTest.java
│ │ ├── JaCoCoParserTest.java
│ │ └── SagaParserTest.java
│ ├── service/
│ │ ├── AbstractServiceSetupTest.java
│ │ ├── AppveyorTest.java
│ │ ├── BambooTest.java
│ │ ├── CircleTest.java
│ │ ├── GeneralTest.java
│ │ ├── JenkinsTest.java
│ │ ├── ShippableTest.java
│ │ ├── TravisTest.java
│ │ └── WerckerTest.java
│ ├── source/
│ │ ├── DirectorySourceLoaderTest.java
│ │ ├── MultiSourceLoaderTest.java
│ │ ├── ScanSourceLoaderTest.java
│ │ ├── UniqueSourceCallbackTest.java
│ │ └── UrlSourceLoaderTest.java
│ ├── util/
│ │ ├── CoverageParsersFactoryTest.java
│ │ ├── ExistingFilesTest.java
│ │ ├── Md5DigestInputStreamTest.java
│ │ ├── SourceLoaderFactoryTest.java
│ │ ├── TestIoUtil.java
│ │ ├── TimestampParserTest.java
│ │ ├── UrlUtilsTest.java
│ │ └── WildcardsTest.java
│ └── validation/
│ ├── JobValidatorTest.java
│ ├── ValidationErrorTest.java
│ ├── ValidationErrorsTest.java
│ └── ValidationExceptionTest.java
└── resources/
├── Components.js
├── InnerClassCoverage.java
├── Localization.js
├── PartialCoverage.java
├── SimpleCoverage.java
├── cobertura.xml
├── jacoco1.xml
├── jacoco2-it.xml
├── jacoco2.xml
└── saga.xml
SYMBOL INDEX (702 symbols across 110 files)
FILE: sample/module1/src/main/java/org/eluder/coverage/sample/InnerClassCoverage.java
class InnerClassCoverage (line 3) | public class InnerClassCoverage {
method anonymous (line 5) | public void anonymous() {
method delegate (line 15) | public boolean delegate() {
class InnerClass (line 19) | public static class InnerClass {
method isInner (line 21) | public boolean isInner() {
method run (line 25) | public void run() {
FILE: sample/module1/src/main/java/org/eluder/coverage/sample/SimpleCoverage.java
class SimpleCoverage (line 3) | public class SimpleCoverage {
method isTested (line 5) | public boolean isTested() {
method neverRun (line 9) | public void neverRun() {
FILE: sample/module1/src/main/resources/Localization.js
function Localization (line 5) | function Localization(values) {
FILE: sample/module1/src/test/java/org/eluder/coverage/sample/InnerClassCoverageTest.java
class InnerClassCoverageTest (line 5) | public class InnerClassCoverageTest {
method testAnonymous (line 7) | @Test
method testDelegate (line 12) | @Test
FILE: sample/module1/src/test/java/org/eluder/coverage/sample/SimpleCoverageTest.java
class SimpleCoverageTest (line 5) | public class SimpleCoverageTest {
method test (line 7) | @Test
FILE: sample/module2/src/main/java/org/eluder/coverage/sample/PartialCoverage.java
class PartialCoverage (line 3) | public class PartialCoverage {
method partial (line 5) | public void partial(boolean test) {
FILE: sample/module2/src/test/java/org/eluder/coverage/sample/PartialCoverageIT.java
class PartialCoverageIT (line 5) | public class PartialCoverageIT {
method testSum (line 7) | @Test
FILE: sample/module2/src/test/java/org/eluder/coverage/sample/PartialCoverageTest.java
class PartialCoverageTest (line 5) | public class PartialCoverageTest {
method testPartial (line 7) | @Test
FILE: src/main/java/org/eluder/coveralls/maven/plugin/CoverageParser.java
type CoverageParser (line 40) | public interface CoverageParser {
method parse (line 50) | void parse(SourceCallback callback) throws ProcessingException, IOExce...
method getCoverageFile (line 55) | File getCoverageFile();
FILE: src/main/java/org/eluder/coveralls/maven/plugin/CoverallsReportMojo.java
class CoverallsReportMojo (line 73) | @Mojo(name = "report", threadSafe = false, aggregator = true)
method execute (line 235) | @Override
method createCoverageParsers (line 277) | protected List<CoverageParser> createCoverageParsers(final SourceLoade...
method createSourceLoader (line 291) | protected SourceLoader createSourceLoader(final Job job) {
method createEnvironment (line 301) | protected Environment createEnvironment() {
method getServices (line 308) | protected List<ServiceSetup> getServices() {
method createJob (line 327) | protected Job createJob() throws ProcessingException, IOException {
method createJsonWriter (line 350) | protected JsonWriter createJsonWriter(final Job job) throws IOException {
method createCoverallsClient (line 357) | protected CoverallsClient createCoverallsClient() {
method createSourceCallbackChain (line 366) | protected SourceCallback createSourceCallbackChain(final JsonWriter wr...
method writeCoveralls (line 386) | protected void writeCoveralls(final JsonWriter writer, final SourceCal...
method submitData (line 403) | private void submitData(final CoverallsClient client, final File cover...
method handleSubmissionError (line 424) | private <T extends Exception> void handleSubmissionError(final T ex, f...
method report (line 433) | private void report(final List<Logger> reporters, final Position posit...
FILE: src/main/java/org/eluder/coveralls/maven/plugin/Environment.java
class Environment (line 37) | public final class Environment {
method Environment (line 42) | public Environment(final CoverallsReportMojo mojo, final Iterable<Serv...
method setup (line 53) | public void setup() {
method verify (line 58) | private void verify() {
method setupService (line 64) | private void setupService() {
method setupEnvironment (line 73) | private void setupEnvironment(final ServiceSetup service) {
FILE: src/main/java/org/eluder/coveralls/maven/plugin/ProcessingException.java
class ProcessingException (line 32) | public class ProcessingException extends Exception {
method ProcessingException (line 34) | public ProcessingException() {
method ProcessingException (line 38) | public ProcessingException(final String message) {
method ProcessingException (line 42) | public ProcessingException(final Throwable cause) {
method ProcessingException (line 46) | public ProcessingException(final String message, final Throwable cause) {
FILE: src/main/java/org/eluder/coveralls/maven/plugin/domain/Branch.java
class Branch (line 29) | public class Branch {
method Branch (line 39) | public Branch(final int lineNumber,
method getLineNumber (line 49) | public int getLineNumber() {
method getBlockNumber (line 53) | public int getBlockNumber() {
method getBranchNumber (line 57) | public int getBranchNumber() {
method getHits (line 61) | public int getHits() {
FILE: src/main/java/org/eluder/coveralls/maven/plugin/domain/CoverallsResponse.java
class CoverallsResponse (line 32) | public final class CoverallsResponse implements JsonObject {
method CoverallsResponse (line 38) | @JsonCreator
method getMessage (line 48) | public String getMessage() {
method isError (line 52) | public boolean isError() {
method getUrl (line 56) | public String getUrl() {
FILE: src/main/java/org/eluder/coveralls/maven/plugin/domain/Git.java
class Git (line 36) | public class Git implements JsonObject {
method Git (line 50) | public Git(final File baseDir, final Head head, final String branch, f...
method getBaseDir (line 57) | public File getBaseDir() {
method getHead (line 61) | public Head getHead() {
method getBranch (line 65) | public String getBranch() {
method getRemotes (line 69) | public List<Remote> getRemotes() {
class Head (line 73) | public static class Head implements Serializable {
method Head (line 92) | public Head(final String id, final String authorName, final String a...
method getId (line 101) | public String getId() {
method getAuthorName (line 105) | public String getAuthorName() {
method getAuthorEmail (line 109) | public String getAuthorEmail() {
method getCommitterName (line 113) | public String getCommitterName() {
method getCommitterEmail (line 117) | public String getCommitterEmail() {
method getMessage (line 121) | public String getMessage() {
class Remote (line 126) | public static class Remote implements Serializable {
method Remote (line 133) | public Remote(final String name, final String url) {
method getName (line 138) | public String getName() {
method getUrl (line 142) | public String getUrl() {
FILE: src/main/java/org/eluder/coveralls/maven/plugin/domain/GitRepository.java
class GitRepository (line 42) | public class GitRepository {
method GitRepository (line 46) | public GitRepository(final File sourceDirectory) {
method load (line 50) | public Git load() throws IOException {
method getHead (line 59) | private Git.Head getHead(final Repository repository) throws IOExcepti...
method getBranch (line 73) | private String getBranch(final Repository repository) throws IOExcepti...
method getRemotes (line 77) | private List<Git.Remote> getRemotes(final Repository repository) {
FILE: src/main/java/org/eluder/coveralls/maven/plugin/domain/Job.java
class Job (line 36) | public class Job {
method Job (line 51) | public Job() {
method withRepoToken (line 55) | public Job withRepoToken(final String repoToken) {
method withServiceName (line 60) | public Job withServiceName(final String serviceName) {
method withServiceJobId (line 65) | public Job withServiceJobId(final String serviceJobId) {
method withServiceBuildNumber (line 70) | public Job withServiceBuildNumber(final String serviceBuildNumber) {
method withServiceBuildUrl (line 75) | public Job withServiceBuildUrl(final String serviceBuildUrl) {
method withParallel (line 80) | public Job withParallel(final boolean parallel) {
method withServiceEnvironment (line 85) | public Job withServiceEnvironment(final Properties serviceEnvironment) {
method withTimestamp (line 90) | public Job withTimestamp(final Date timestamp) {
method withDryRun (line 95) | public Job withDryRun(final boolean dryRun) {
method withBranch (line 100) | public Job withBranch(final String branch) {
method withPullRequest (line 105) | public Job withPullRequest(final String pullRequest) {
method withGit (line 110) | public Job withGit(final Git git) {
method getRepoToken (line 115) | public String getRepoToken() {
method getServiceName (line 119) | public String getServiceName() {
method getServiceJobId (line 123) | public String getServiceJobId() {
method getServiceBuildNumber (line 127) | public String getServiceBuildNumber() {
method getServiceBuildUrl (line 131) | public String getServiceBuildUrl() {
method getServiceEnvironment (line 135) | public Properties getServiceEnvironment() {
method getTimestamp (line 139) | public Date getTimestamp() {
method isParallel (line 143) | public boolean isParallel() {
method isDryRun (line 147) | public boolean isDryRun() {
method getBranch (line 151) | public String getBranch() {
method getPullRequest (line 162) | public String getPullRequest() {
method getGit (line 166) | public Git getGit() {
method validate (line 170) | public ValidationErrors validate() {
FILE: src/main/java/org/eluder/coveralls/maven/plugin/domain/JsonObject.java
type JsonObject (line 35) | @JsonIgnoreProperties(ignoreUnknown = true)
FILE: src/main/java/org/eluder/coveralls/maven/plugin/domain/Source.java
class Source (line 40) | public final class Source implements JsonObject {
method Source (line 51) | public Source(final String name, final String source, final String dig...
method Source (line 55) | protected Source(final String name, final int lines, final String dige...
method getName (line 63) | @JsonIgnore
method getFullName (line 68) | @JsonProperty("name")
method getDigest (line 76) | @JsonProperty("source_digest")
method getCoverage (line 81) | @JsonProperty("coverage")
method getBranches (line 86) | @JsonProperty("branches")
method getBranchesList (line 98) | public List<Branch> getBranchesList() {
method getClassifier (line 102) | @JsonIgnore
method setClassifier (line 107) | public void setClassifier(final String classifier) {
method checkLineRange (line 111) | private void checkLineRange(final int lineNumber) {
method addCoverage (line 118) | public void addCoverage(final int lineNumber, final Integer coverage) {
method addBranchCoverage (line 123) | public void addBranchCoverage(final int lineNumber,
method addBranchCoverage (line 130) | private void addBranchCoverage(final boolean merge,
method merge (line 152) | public Source merge(final Source source) {
method equals (line 174) | @Override
method hashCode (line 185) | @Override
method getLines (line 190) | private static int getLines(final String source) {
FILE: src/main/java/org/eluder/coveralls/maven/plugin/httpclient/CoverallsClient.java
class CoverallsClient (line 50) | public class CoverallsClient {
method CoverallsClient (line 67) | public CoverallsClient(final String coverallsUrl) {
method CoverallsClient (line 71) | public CoverallsClient(final String coverallsUrl, final HttpClient htt...
method submit (line 77) | public CoverallsResponse submit(final File file) throws ProcessingExce...
method parseResponse (line 88) | private CoverallsResponse parseResponse(final HttpResponse response) t...
method getResponseErrorMessage (line 114) | private String getResponseErrorMessage(final HttpResponse response, fi...
FILE: src/main/java/org/eluder/coveralls/maven/plugin/httpclient/CoverallsProxyClient.java
class CoverallsProxyClient (line 32) | public class CoverallsProxyClient extends CoverallsClient {
method CoverallsProxyClient (line 34) | public CoverallsProxyClient(final String coverallsUrl, final Proxy pro...
FILE: src/main/java/org/eluder/coveralls/maven/plugin/httpclient/HttpClientFactory.java
class HttpClientFactory (line 42) | class HttpClientFactory {
method HttpClientFactory (line 54) | HttpClientFactory(final String targetUrl) {
method proxy (line 58) | public HttpClientFactory proxy(final Proxy proxy) {
method create (line 73) | public HttpClient create() {
method isProxied (line 77) | private boolean isProxied(final String url, final Proxy proxy) {
FILE: src/main/java/org/eluder/coveralls/maven/plugin/json/JsonWriter.java
class JsonWriter (line 47) | public class JsonWriter implements SourceCallback, Closeable {
method JsonWriter (line 55) | public JsonWriter(final Job job, final File coverallsFile) throws IOEx...
method getJob (line 65) | public final Job getJob() {
method getCoverallsFile (line 69) | public final File getCoverallsFile() {
method onBegin (line 73) | @Override
method onSource (line 94) | @Override
method onComplete (line 103) | @Override
method close (line 113) | @Override
method writeOptionalString (line 118) | private void writeOptionalString(final String field, final String valu...
method writeOptionalBoolean (line 124) | private void writeOptionalBoolean(final String field, final boolean va...
method writeOptionalObject (line 130) | private void writeOptionalObject(final String field, final Object valu...
method writeOptionalTimestamp (line 136) | private void writeOptionalTimestamp(final String field, final Date val...
method writeOptionalEnvironment (line 143) | private void writeOptionalEnvironment(final String field, final Proper...
FILE: src/main/java/org/eluder/coveralls/maven/plugin/logging/CoverageTracingLogger.java
class CoverageTracingLogger (line 38) | public class CoverageTracingLogger extends ChainingSourceCallback implem...
method CoverageTracingLogger (line 47) | public CoverageTracingLogger(final SourceCallback chained) {
method getFiles (line 51) | public long getFiles() {
method getLines (line 55) | public final long getLines() {
method getRelevant (line 59) | public final long getRelevant() {
method getCovered (line 63) | public final long getCovered() {
method getMissed (line 67) | public final long getMissed() {
method getBranches (line 71) | public final long getBranches() {
method getCoveredBranches (line 75) | public final long getCoveredBranches() {
method getMissedBranches (line 79) | public final long getMissedBranches() {
method getPosition (line 83) | @Override
method log (line 88) | @Override
method onSourceInternal (line 99) | @Override
FILE: src/main/java/org/eluder/coveralls/maven/plugin/logging/DryRunLogger.java
class DryRunLogger (line 33) | public class DryRunLogger implements Logger {
method DryRunLogger (line 38) | public DryRunLogger(final boolean dryRun, final File coverallsFile) {
method getPosition (line 46) | @Override
method log (line 51) | @Override
FILE: src/main/java/org/eluder/coveralls/maven/plugin/logging/JobLogger.java
class JobLogger (line 37) | public class JobLogger implements Logger {
method JobLogger (line 44) | public JobLogger(final Job job) {
method JobLogger (line 48) | public JobLogger(final Job job, final ObjectMapper jsonMapper) {
method getPosition (line 56) | @Override
method log (line 61) | @Override
method createDefaultJsonMapper (line 103) | private ObjectMapper createDefaultJsonMapper() {
FILE: src/main/java/org/eluder/coveralls/maven/plugin/logging/Logger.java
type Logger (line 31) | public interface Logger {
type Position (line 36) | enum Position {
method getPosition (line 44) | Position getPosition();
method log (line 51) | void log(Log log);
FILE: src/main/java/org/eluder/coveralls/maven/plugin/parser/AbstractXmlEventParser.java
class AbstractXmlEventParser (line 47) | public abstract class AbstractXmlEventParser implements CoverageParser {
method AbstractXmlEventParser (line 52) | public AbstractXmlEventParser(final File coverageFile, final SourceLoa...
method parse (line 57) | @Override
method getCoverageFile (line 74) | @Override
method createEventReader (line 79) | protected XMLStreamReader createEventReader(final Reader reader) throw...
method close (line 93) | private void close(final XMLStreamReader xml) throws ProcessingExcepti...
method onEvent (line 103) | protected abstract void onEvent(final XMLStreamReader xml, SourceCallb...
method loadSource (line 105) | protected final Source loadSource(final String sourceFile) throws IOEx...
method isStartElement (line 109) | protected final boolean isStartElement(final XMLStreamReader xml, fina...
method isEndElement (line 113) | protected final boolean isEndElement(final XMLStreamReader xml, final ...
FILE: src/main/java/org/eluder/coveralls/maven/plugin/parser/CoberturaParser.java
class CoberturaParser (line 39) | public class CoberturaParser extends AbstractXmlEventParser {
method CoberturaParser (line 45) | public CoberturaParser(final File coverageFile, final SourceLoader sou...
method onEvent (line 49) | @Override
FILE: src/main/java/org/eluder/coveralls/maven/plugin/parser/JaCoCoParser.java
class JaCoCoParser (line 39) | public class JaCoCoParser extends AbstractXmlEventParser {
method JaCoCoParser (line 45) | public JaCoCoParser(final File coverageFile, final SourceLoader source...
method onEvent (line 49) | @Override
FILE: src/main/java/org/eluder/coveralls/maven/plugin/parser/SagaParser.java
class SagaParser (line 41) | public class SagaParser extends CoberturaParser {
method SagaParser (line 43) | public SagaParser(final File coverageFile, final SourceLoader sourceLo...
method onEvent (line 47) | @Override
FILE: src/main/java/org/eluder/coveralls/maven/plugin/service/AbstractServiceSetup.java
class AbstractServiceSetup (line 37) | public abstract class AbstractServiceSetup implements ServiceSetup {
method AbstractServiceSetup (line 41) | public AbstractServiceSetup(final Map<String, String> env) {
method getJobId (line 45) | @Override
method getBuildNumber (line 50) | @Override
method getBuildUrl (line 55) | @Override
method getBranch (line 60) | @Override
method getPullRequest (line 65) | @Override
method getEnvironment (line 70) | @Override
method getProperty (line 75) | protected final String getProperty(final String name) {
method addProperty (line 79) | protected final void addProperty(final Properties properties, final St...
FILE: src/main/java/org/eluder/coveralls/maven/plugin/service/Appveyor.java
class Appveyor (line 36) | public class Appveyor extends AbstractServiceSetup {
method Appveyor (line 47) | public Appveyor(final Map<String, String> env) {
method isSelected (line 51) | @Override
method getName (line 56) | @Override
method getBuildNumber (line 61) | @Override
method getBuildUrl (line 66) | @Override
method getBranch (line 71) | @Override
method getPullRequest (line 76) | @Override
method getJobId (line 82) | @Override
FILE: src/main/java/org/eluder/coveralls/maven/plugin/service/Bamboo.java
class Bamboo (line 36) | public class Bamboo extends AbstractServiceSetup {
method Bamboo (line 43) | public Bamboo(final Map<String, String> env) {
method isSelected (line 47) | @Override
method getName (line 52) | @Override
method getBuildNumber (line 57) | @Override
method getBuildUrl (line 62) | @Override
method getBranch (line 67) | @Override
FILE: src/main/java/org/eluder/coveralls/maven/plugin/service/Circle.java
class Circle (line 37) | public class Circle extends AbstractServiceSetup {
method Circle (line 45) | public Circle(final Map<String, String> env) {
method isSelected (line 49) | @Override
method getName (line 54) | @Override
method getBuildNumber (line 59) | @Override
method getBranch (line 64) | @Override
method getEnvironment (line 69) | @Override
FILE: src/main/java/org/eluder/coveralls/maven/plugin/service/General.java
class General (line 35) | public class General extends AbstractServiceSetup {
method General (line 43) | public General(final Map<String, String> env) {
method isSelected (line 47) | @Override
method getName (line 52) | @Override
method getBuildNumber (line 57) | @Override
method getBuildUrl (line 62) | @Override
method getBranch (line 67) | @Override
method getPullRequest (line 72) | @Override
FILE: src/main/java/org/eluder/coveralls/maven/plugin/service/Jenkins.java
class Jenkins (line 37) | public class Jenkins extends AbstractServiceSetup {
method Jenkins (line 46) | public Jenkins(final Map<String, String> env) {
method isSelected (line 50) | @Override
method getName (line 55) | @Override
method getBuildNumber (line 60) | @Override
method getBuildUrl (line 65) | @Override
method getBranch (line 70) | @Override
method getEnvironment (line 75) | @Override
FILE: src/main/java/org/eluder/coveralls/maven/plugin/service/ServiceSetup.java
type ServiceSetup (line 34) | public interface ServiceSetup {
method isSelected (line 39) | boolean isSelected();
method getName (line 44) | String getName();
method getJobId (line 49) | String getJobId();
method getBuildNumber (line 54) | String getBuildNumber();
method getBuildUrl (line 59) | String getBuildUrl();
method getBranch (line 64) | String getBranch();
method getPullRequest (line 69) | String getPullRequest();
method getEnvironment (line 74) | Properties getEnvironment();
FILE: src/main/java/org/eluder/coveralls/maven/plugin/service/Shippable.java
class Shippable (line 37) | public class Shippable extends AbstractServiceSetup {
method Shippable (line 47) | public Shippable(final Map<String, String> env) {
method isSelected (line 51) | @Override
method getName (line 56) | @Override
method getBuildNumber (line 61) | @Override
method getBuildUrl (line 66) | @Override
method getBranch (line 71) | @Override
method getPullRequest (line 76) | @Override
method getEnvironment (line 85) | @Override
FILE: src/main/java/org/eluder/coveralls/maven/plugin/service/Travis.java
class Travis (line 37) | public class Travis extends AbstractServiceSetup {
method Travis (line 45) | public Travis(final Map<String, String> env) {
method isSelected (line 49) | @Override
method getName (line 54) | @Override
method getJobId (line 59) | @Override
method getBranch (line 64) | @Override
method getPullRequest (line 69) | @Override
method getEnvironment (line 74) | @Override
FILE: src/main/java/org/eluder/coveralls/maven/plugin/service/Wercker.java
class Wercker (line 36) | public class Wercker extends AbstractServiceSetup {
method Wercker (line 44) | public Wercker(final Map<String, String> env) {
method isSelected (line 48) | @Override
method getName (line 53) | @Override
method getJobId (line 58) | @Override
method getBuildUrl (line 63) | @Override
method getBranch (line 68) | @Override
FILE: src/main/java/org/eluder/coveralls/maven/plugin/source/AbstractSourceLoader.java
class AbstractSourceLoader (line 40) | public abstract class AbstractSourceLoader implements SourceLoader {
method AbstractSourceLoader (line 45) | public AbstractSourceLoader(final URI base, final URI sourceBase, fina...
method load (line 50) | @Override
method getSourceEncoding (line 66) | protected Charset getSourceEncoding() {
method getFileName (line 70) | protected String getFileName(final String sourceFile) {
method locate (line 74) | protected abstract InputStream locate(String sourceFile) throws IOExce...
FILE: src/main/java/org/eluder/coveralls/maven/plugin/source/ChainingSourceCallback.java
class ChainingSourceCallback (line 38) | public abstract class ChainingSourceCallback implements SourceCallback {
method ChainingSourceCallback (line 42) | public ChainingSourceCallback(final SourceCallback chained) {
method onBegin (line 49) | @Override
method onSource (line 55) | @Override
method onComplete (line 61) | @Override
method onBeginInternal (line 75) | protected void onBeginInternal() throws ProcessingException, IOExcepti...
method onSourceInternal (line 86) | protected abstract void onSourceInternal(final Source source) throws P...
method onCompleteInternal (line 96) | protected void onCompleteInternal() throws ProcessingException, IOExce...
FILE: src/main/java/org/eluder/coveralls/maven/plugin/source/DirectorySourceLoader.java
class DirectorySourceLoader (line 35) | public class DirectorySourceLoader extends AbstractSourceLoader {
method DirectorySourceLoader (line 39) | public DirectorySourceLoader(final File base, final File sourceDirecto...
method locate (line 44) | @Override
FILE: src/main/java/org/eluder/coveralls/maven/plugin/source/MultiSourceLoader.java
class MultiSourceLoader (line 35) | public class MultiSourceLoader implements SourceLoader {
method add (line 39) | public MultiSourceLoader add(final SourceLoader sourceLoader) {
method load (line 44) | @Override
FILE: src/main/java/org/eluder/coveralls/maven/plugin/source/ScanSourceLoader.java
class ScanSourceLoader (line 41) | public class ScanSourceLoader extends AbstractSourceLoader {
method ScanSourceLoader (line 47) | public ScanSourceLoader(final File base, final File sourceDirectory, f...
method locate (line 52) | @Override
method scanFor (line 65) | private String[] scanFor(final String extension) {
method getFileName (line 78) | protected String getFileName(final String sourceFile) {
FILE: src/main/java/org/eluder/coveralls/maven/plugin/source/SourceCallback.java
type SourceCallback (line 37) | public interface SourceCallback {
method onBegin (line 45) | void onBegin() throws ProcessingException, IOException;
method onSource (line 54) | void onSource(Source source) throws ProcessingException, IOException;
method onComplete (line 62) | void onComplete() throws ProcessingException, IOException;
FILE: src/main/java/org/eluder/coveralls/maven/plugin/source/SourceLoader.java
type SourceLoader (line 33) | public interface SourceLoader {
method load (line 35) | Source load(String sourceFile) throws IOException;
FILE: src/main/java/org/eluder/coveralls/maven/plugin/source/UniqueSourceCallback.java
class UniqueSourceCallback (line 42) | public class UniqueSourceCallback implements SourceCallback {
method UniqueSourceCallback (line 47) | public UniqueSourceCallback(final SourceCallback delegate) {
method onBegin (line 52) | @Override
method onSource (line 57) | @Override
method onComplete (line 63) | @Override
FILE: src/main/java/org/eluder/coveralls/maven/plugin/source/UrlSourceLoader.java
class UrlSourceLoader (line 35) | public class UrlSourceLoader extends AbstractSourceLoader {
method UrlSourceLoader (line 39) | public UrlSourceLoader(final URL base, final URL sourceUrl, final Stri...
method locate (line 44) | @Override
FILE: src/main/java/org/eluder/coveralls/maven/plugin/util/CoverageParsersFactory.java
class CoverageParsersFactory (line 42) | public class CoverageParsersFactory {
method CoverageParsersFactory (line 61) | public CoverageParsersFactory(final MavenProject project, final Source...
method withJaCoCoReports (line 66) | public CoverageParsersFactory withJaCoCoReports(final List<File> jacoc...
method withCoberturaReports (line 71) | public CoverageParsersFactory withCoberturaReports(final List<File> co...
method withSagaReports (line 76) | public CoverageParsersFactory withSagaReports(final List<File> sagaRep...
method withRelativeReportDirs (line 81) | public CoverageParsersFactory withRelativeReportDirs(final List<String...
method createParsers (line 86) | public List<CoverageParser> createParsers() throws IOException {
FILE: src/main/java/org/eluder/coveralls/maven/plugin/util/ExistingFiles.java
class ExistingFiles (line 33) | public class ExistingFiles implements Iterable<File> {
method addAll (line 37) | public ExistingFiles addAll(final Iterable<File> files) {
method add (line 47) | public ExistingFiles add(final File file) {
method iterator (line 57) | @Override
method create (line 62) | public static ExistingFiles create(final Iterable<File> files) {
FILE: src/main/java/org/eluder/coveralls/maven/plugin/util/MavenProjectCollector.java
class MavenProjectCollector (line 35) | public class MavenProjectCollector {
method MavenProjectCollector (line 39) | public MavenProjectCollector(final MavenProject root) {
method collect (line 43) | public List<MavenProject> collect() {
method collect (line 49) | private void collect(final MavenProject project, final List<MavenProje...
FILE: src/main/java/org/eluder/coveralls/maven/plugin/util/Md5DigestInputStream.java
class Md5DigestInputStream (line 35) | public class Md5DigestInputStream extends DigestInputStream {
method Md5DigestInputStream (line 37) | public Md5DigestInputStream(final InputStream stream) throws NoSuchAlg...
method getDigestHex (line 41) | public String getDigestHex() {
FILE: src/main/java/org/eluder/coveralls/maven/plugin/util/SourceLoaderFactory.java
class SourceLoaderFactory (line 39) | public class SourceLoaderFactory {
method SourceLoaderFactory (line 47) | public SourceLoaderFactory(final File baseDir, final MavenProject proj...
method withSourceDirectories (line 53) | public SourceLoaderFactory withSourceDirectories(final List<File> sour...
method withScanForSources (line 58) | public SourceLoaderFactory withScanForSources(final boolean scanForSou...
method createSourceLoader (line 63) | public SourceLoader createSourceLoader() {
FILE: src/main/java/org/eluder/coveralls/maven/plugin/util/TimestampParser.java
class TimestampParser (line 37) | public class TimestampParser {
method TimestampParser (line 45) | public TimestampParser(final String format) {
method parse (line 59) | public Date parse(final String timestamp) throws ProcessingException {
type Parser (line 70) | private interface Parser {
method parse (line 71) | Date parse(String timestamp) throws Exception;
class DateFormatParser (line 74) | private static class DateFormatParser implements Parser {
method DateFormatParser (line 78) | DateFormatParser(final String format) {
method parse (line 82) | @Override
class EpochMillisParser (line 88) | private static class EpochMillisParser implements Parser {
method parse (line 90) | @Override
FILE: src/main/java/org/eluder/coveralls/maven/plugin/util/UrlUtils.java
class UrlUtils (line 34) | public final class UrlUtils {
method create (line 36) | public static URL create(final String url) {
method toUri (line 44) | public static URI toUri(final URL url) {
method UrlUtils (line 52) | private UrlUtils() {
FILE: src/main/java/org/eluder/coveralls/maven/plugin/util/Wildcards.java
class Wildcards (line 32) | public final class Wildcards {
method matches (line 42) | public static boolean matches(final String text, final String wildcard) {
method Wildcards (line 47) | private Wildcards() {
FILE: src/main/java/org/eluder/coveralls/maven/plugin/validation/JobValidator.java
class JobValidator (line 36) | public class JobValidator {
method JobValidator (line 40) | public JobValidator(final Job job) {
method validate (line 47) | public ValidationErrors validate() {
method repoTokenOrTravis (line 54) | private List<ValidationError> repoTokenOrTravis() {
method git (line 66) | private List<ValidationError> git() {
method hasValue (line 76) | private boolean hasValue(final String value) {
FILE: src/main/java/org/eluder/coveralls/maven/plugin/validation/ValidationError.java
class ValidationError (line 29) | public final class ValidationError {
type Level (line 31) | public enum Level {
method ValidationError (line 38) | public ValidationError(final Level level, final String message) {
method getLevel (line 49) | public Level getLevel() {
method getMessage (line 53) | public String getMessage() {
method toString (line 57) | @Override
FILE: src/main/java/org/eluder/coveralls/maven/plugin/validation/ValidationErrors.java
class ValidationErrors (line 35) | public class ValidationErrors extends ArrayList<ValidationError> {
method throwOrInform (line 37) | public void throwOrInform(final Log log) {
method filter (line 47) | private List<ValidationError> filter(final Level level) {
FILE: src/main/java/org/eluder/coveralls/maven/plugin/validation/ValidationException.java
class ValidationException (line 29) | public class ValidationException extends IllegalArgumentException {
method ValidationException (line 31) | public ValidationException() {
method ValidationException (line 35) | public ValidationException(final String s) {
method ValidationException (line 39) | public ValidationException(final Throwable cause) {
method ValidationException (line 43) | public ValidationException(final String message, final Throwable cause) {
FILE: src/test/java/org/eluder/coveralls/maven/plugin/CoverageFixture.java
class CoverageFixture (line 29) | public final class CoverageFixture {
method getTotalLines (line 51) | public static int getTotalLines(String[][] fixture) {
method getTotalFiles (line 59) | public static int getTotalFiles(String[][] fixture) {
method CoverageFixture (line 63) | private CoverageFixture() {
FILE: src/test/java/org/eluder/coveralls/maven/plugin/CoverallsReportMojoTest.java
class CoverallsReportMojoTest (line 72) | @RunWith(MockitoJUnitRunner.class)
method init (line 111) | @Before
method testCreateCoverageParsersWithoutCoverageReports (line 180) | @Test(expected = IOException.class)
method testCreateSourceLoader (line 188) | @Test
method testDefaultBehavior (line 203) | @Test
method testSuccesfullSubmission (line 228) | @Test
method testFailWithProcessingException (line 243) | @Test
method testProcessingExceptionWithAllowedServiceFailure (line 254) | @Test
method testFailWithIOException (line 266) | @Test
method testIOExceptionWithAllowedServiceFailure (line 277) | @Test
method testFailWithNullPointerException (line 285) | @Test
method testSkipExecution (line 296) | @Test
method verifySuccessfullSubmit (line 304) | public static void verifySuccessfullSubmit(Log logMock, String[][] fix...
method readFileContent (line 309) | protected String readFileContent(final String sourceFile) throws IOExc...
FILE: src/test/java/org/eluder/coveralls/maven/plugin/EnvironmentTest.java
class EnvironmentTest (line 47) | @RunWith(MockitoJUnitRunner.class)
method init (line 61) | @Before
method testMissingMojo (line 79) | @Test(expected = IllegalArgumentException.class)
method testMissingServices (line 84) | @Test(expected = IllegalArgumentException.class)
method testSetupWithoutServices (line 89) | @Test
method testSetupWithoutSourceEncoding (line 95) | @Test(expected = IllegalArgumentException.class)
method testSetupWithIncompleteJob (line 101) | @Test
method testSetupWithCompleteJob (line 116) | @Test
method testSetupWithoutJobOverride (line 139) | @Test
method create (line 170) | private Environment create(final Iterable<ServiceSetup> services) {
FILE: src/test/java/org/eluder/coveralls/maven/plugin/ProcessingExceptionTest.java
class ProcessingExceptionTest (line 35) | public class ProcessingExceptionTest {
method testException (line 40) | @Test
method testExceptionWithMessage (line 47) | @Test
method testExceptionWithCause (line 54) | @Test
method testExceptionWithMessageAndCause (line 61) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/domain/GitRepositoryTest.java
class GitRepositoryTest (line 34) | public class GitRepositoryTest {
method testLoad (line 39) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/domain/JobTest.java
class JobTest (line 39) | public class JobTest {
method testGetBranchWithRemote (line 41) | @Test
method testGetBranch (line 50) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/domain/SourceTest.java
class SourceTest (line 34) | public class SourceTest {
method testAddCoverage (line 36) | @Test
method testAddBranchCoverage (line 44) | @Test
method testAddSameBranchReplaceExistingOne (line 52) | @Test
method testAddSameBranchDoNotKeepOrdering (line 60) | @Test
method testAddCoverageForSourceOutOfBounds (line 69) | @Test(expected = IllegalArgumentException.class)
method testAddBranchCoverageForSourceOutOfBounds (line 75) | @Test(expected = IllegalArgumentException.class)
method testGetNameWithClassifier (line 81) | @Test
method testMerge (line 90) | @Test
method testMergeDifferent (line 122) | @Test
method testEqualsForNull (line 134) | @Test
method testEqualsForDifferentSources (line 140) | @Test
method testHashCode (line 147) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/httpclient/CoverallsClientTest.java
class CoverallsClientTest (line 60) | @RunWith(MockitoJUnitRunner.class)
method init (line 77) | @Before
method testConstructors (line 82) | @Test
method testSubmit (line 88) | @Test
method testFailOnServiceError (line 99) | @Test(expected = IOException.class)
method testParseInvalidResponse (line 108) | @Test(expected = ProcessingException.class)
method testParseErrorousResponse (line 119) | @Test(expected = ProcessingException.class)
method testParseFailingEntity (line 130) | @Test(expected = IOException.class)
method testParseEntityWithoutContentType (line 141) | @Test(expected = ProcessingException.class)
method coverallsResponse (line 159) | private InputStream coverallsResponse(final CoverallsResponse coverall...
FILE: src/test/java/org/eluder/coveralls/maven/plugin/httpclient/CoverallsProxyClientTest.java
class CoverallsProxyClientTest (line 34) | public class CoverallsProxyClientTest {
method testConstructorWithoutProxy (line 36) | @Test
method testConstructorWithProxy (line 41) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/httpclient/HttpClientFactoryTest.java
class HttpClientFactoryTest (line 40) | public class HttpClientFactoryTest {
method testSimpleRequest (line 53) | @Test
method testUnAuthorizedProxyRequest (line 63) | @Test
method testAuthorixedProxyRequest (line 80) | @Test
method testNonProxiedHostRequest (line 104) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/json/JsonWriterTest.java
class JsonWriterTest (line 55) | public class JsonWriterTest {
method init (line 64) | @Before
method testSubDirectoryCreation (line 69) | @Test
method testGetJob (line 76) | @Test
method testGetCoverallsFile (line 83) | @Test
method testWriteStartAndEnd (line 91) | @SuppressWarnings("rawtypes")
method testOnSource (line 116) | @Test
method job (line 134) | private Job job() {
method source (line 151) | private Source source() {
method stringToJsonMap (line 155) | private Map<String, Object> stringToJsonMap(final String content) thro...
FILE: src/test/java/org/eluder/coveralls/maven/plugin/logging/CoverageTracingLoggerTest.java
class CoverageTracingLoggerTest (line 44) | @RunWith(MockitoJUnitRunner.class)
method testConstructorWithNull (line 53) | @Test(expected = IllegalArgumentException.class)
method testGetPosition (line 58) | @Test
method testLogForSources (line 63) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/logging/DryRunLoggerTest.java
class DryRunLoggerTest (line 43) | @RunWith(MockitoJUnitRunner.class)
method testMissingCoverallsFile (line 52) | @Test(expected = IllegalArgumentException.class)
method testGetPosition (line 57) | @Test
method testLogDryRunDisabled (line 62) | @Test
method testLogDryRunEnabled (line 69) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/logging/JobLoggerTest.java
class JobLoggerTest (line 48) | @RunWith(MockitoJUnitRunner.class)
method testMissingJob (line 60) | @Test(expected = IllegalArgumentException.class)
method testGetPosition (line 65) | @Test
method testLogJobWithId (line 70) | @Test
method testLogWithBuildNumberAndUrl (line 88) | @Test
method testLogDryRun (line 101) | @Test
method testLogParallel (line 112) | @Test
method testLogJobWithDebug (line 124) | @Test
method testLogJobWithErrorInDebug (line 138) | @Test(expected = RuntimeException.class)
FILE: src/test/java/org/eluder/coveralls/maven/plugin/parser/AbstractCoverageParserTest.java
class AbstractCoverageParserTest (line 60) | @RunWith(MockitoJUnitRunner.class)
method init (line 69) | @Before
method sourceName (line 78) | protected String sourceName(final String coverageFile) {
method sourceAnswer (line 82) | protected Answer<Source> sourceAnswer(final String name, final String ...
method testParseCoverage (line 91) | @Test
method createCoverageParser (line 119) | protected abstract CoverageParser createCoverageParser(File coverageFi...
method getCoverageResources (line 121) | protected abstract List<String> getCoverageResources();
method getCoverageFixture (line 123) | protected abstract String[][] getCoverageFixture();
method toIntegerSet (line 125) | private Set<Integer> toIntegerSet(final String commaSeparated) {
class SourceCollector (line 137) | private static class SourceCollector implements SourceCallback {
method onBegin (line 141) | @Override
method onSource (line 146) | @Override
method onComplete (line 151) | @Override
class ClassifierRemover (line 157) | private static class ClassifierRemover extends ChainingSourceCallback {
method ClassifierRemover (line 159) | public ClassifierRemover(SourceCallback chained) {
method onSourceInternal (line 163) | @Override
method assertCoverage (line 169) | private static void assertCoverage(final Collection<Source> sources, f...
FILE: src/test/java/org/eluder/coveralls/maven/plugin/parser/CoberturaParserTest.java
class CoberturaParserTest (line 37) | public class CoberturaParserTest extends AbstractCoverageParserTest {
method createCoverageParser (line 39) | @Override
method getCoverageResources (line 44) | @Override
method getCoverageFixture (line 49) | @Override
FILE: src/test/java/org/eluder/coveralls/maven/plugin/parser/JaCoCoParserTest.java
class JaCoCoParserTest (line 37) | public class JaCoCoParserTest extends AbstractCoverageParserTest {
method createCoverageParser (line 39) | @Override
method getCoverageResources (line 44) | @Override
method getCoverageFixture (line 49) | @Override
FILE: src/test/java/org/eluder/coveralls/maven/plugin/parser/SagaParserTest.java
class SagaParserTest (line 40) | public class SagaParserTest extends AbstractCoverageParserTest {
method createCoverageParser (line 42) | @Override
method getCoverageResources (line 47) | @Override
method getCoverageFixture (line 52) | @Override
FILE: src/test/java/org/eluder/coveralls/maven/plugin/service/AbstractServiceSetupTest.java
class AbstractServiceSetupTest (line 38) | public class AbstractServiceSetupTest {
method testGetMissingProperty (line 40) | @Test
method testGetProperty (line 46) | @Test
method testAddPropertyWithoutName (line 53) | @Test(expected = IllegalArgumentException.class)
method testAddPropertyWithoutValue (line 58) | @Test
method testAddPropertyWithValue (line 65) | @Test
method testGetDefaultValues (line 72) | @Test
method create (line 84) | private AbstractServiceSetup create(final Map<String, String> env) {
FILE: src/test/java/org/eluder/coveralls/maven/plugin/service/AppveyorTest.java
class AppveyorTest (line 36) | public class AppveyorTest {
method env (line 38) | private Map<String, String> env() {
method testIsSelectedForNothing (line 50) | @Test
method testIsSelectedForAppveyor (line 55) | @Test
method testGetName (line 60) | @Test
method testGetBuildNumber (line 65) | @Test
method testGetBuildUrl (line 70) | @Test
method testGetBranch (line 75) | @Test
method testPullRequest (line 80) | @Test
method testGetJobId (line 85) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/service/BambooTest.java
class BambooTest (line 38) | public class BambooTest {
method env (line 40) | private Map<String, String> env() {
method testIsSelectedForNothing (line 48) | @Test
method testIsSelectedForBamboo (line 53) | @Test
method testGetName (line 58) | @Test
method testGetBuildNumber (line 63) | @Test
method testGetBuildUrl (line 68) | @Test
method testGetBranch (line 73) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/service/CircleTest.java
class CircleTest (line 39) | public class CircleTest {
method env (line 41) | private Map<String, String> env() {
method testIsSelectedForNothing (line 50) | @Test
method testIsSelectedForCircle (line 55) | @Test
method testGetName (line 60) | @Test
method testGetBuildNumber (line 65) | @Test
method testGetBranch (line 70) | @Test
method testGetEnvironment (line 75) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/service/GeneralTest.java
class GeneralTest (line 38) | public class GeneralTest {
method env (line 40) | private Map<String, String> env() {
method testIsSelectedForNothing (line 50) | @Test
method testIsSelectedForCi (line 55) | @Test
method testGetName (line 60) | @Test
method testGetBuildNumber (line 65) | @Test
method testGetBuildUrl (line 70) | @Test
method testGetBranch (line 75) | @Test
method testGetPullRequest (line 80) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/service/JenkinsTest.java
class JenkinsTest (line 39) | public class JenkinsTest {
method env (line 41) | private Map<String, String> env() {
method testIsSelectedForNothing (line 51) | @Test
method testIsSelectedForJenkins (line 56) | @Test
method testGetName (line 61) | @Test
method testGetBuildNumber (line 66) | @Test
method testGetBuildUrl (line 71) | @Test
method testGetBranch (line 76) | @Test
method testGetEnvironment (line 81) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/service/ShippableTest.java
class ShippableTest (line 37) | public class ShippableTest {
method env (line 39) | private Map<String, String> env() {
method testIsSelectedForNothing (line 50) | @Test
method testIsSelectedForShippable (line 55) | @Test
method testGetName (line 60) | @Test
method testGetBuildNumber (line 65) | @Test
method testGetBuildUrl (line 70) | @Test
method testGetBranch (line 75) | @Test
method testPullRequest (line 80) | @Test
method testPullRequestFalse (line 85) | @Test
method testGetEnvironment (line 92) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/service/TravisTest.java
class TravisTest (line 39) | public class TravisTest {
method env (line 41) | private Map<String, String> env() {
method testIsSelectedForNothing (line 50) | @Test
method testIsSelectedForTravis (line 55) | @Test
method testGetName (line 60) | @Test
method testGetJobId (line 65) | @Test
method testGetBranch (line 70) | @Test
method testGetPullRequest (line 75) | @Test
method testGetEnvironment (line 80) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/service/WerckerTest.java
class WerckerTest (line 38) | public class WerckerTest {
method env (line 40) | private Map<String, String> env() {
method testIsSelectedForNothing (line 49) | @Test
method testIsSelectedForWercker (line 54) | @Test
method testGetName (line 59) | @Test
method testGetJobId (line 64) | @Test
method testGetBuildUrl (line 69) | @Test
method testGetBranch (line 74) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/source/DirectorySourceLoaderTest.java
class DirectorySourceLoaderTest (line 43) | @RunWith(MockitoJUnitRunner.class)
method testMissingSourceFileFromDirectory (line 55) | @Test
method testInvalidSourceFile (line 61) | @Test(expected = IllegalArgumentException.class)
method testLoadSource (line 68) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/source/MultiSourceLoaderTest.java
class MultiSourceLoaderTest (line 40) | @RunWith(MockitoJUnitRunner.class)
method testMissingSource (line 53) | @Test(expected = IOException.class)
method testPrimarySource (line 58) | @Test
method testSecondarySource (line 65) | @Test
method creaMultiSourceLoader (line 72) | private MultiSourceLoader creaMultiSourceLoader() {
FILE: src/test/java/org/eluder/coveralls/maven/plugin/source/ScanSourceLoaderTest.java
class ScanSourceLoaderTest (line 43) | @RunWith(MockitoJUnitRunner.class)
method testMissingSourceFileFromDirectory (line 55) | @Test
method testInvalidSourceFile (line 61) | @Test(expected = IllegalArgumentException.class)
method testLoadSource (line 68) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/source/UniqueSourceCallbackTest.java
class UniqueSourceCallbackTest (line 40) | @RunWith(MockitoJUnitRunner.class)
method testOnSourceWithUniqueFiles (line 46) | @Test
method testOnSourceWithDuplicateSources (line 61) | @Test
method testOnSourceWithUniqueSources (line 76) | @Test
method createUniqueSourceCallback (line 91) | private UniqueSourceCallback createUniqueSourceCallback() {
method createSource (line 95) | private Source createSource(final String name, final String source, fi...
FILE: src/test/java/org/eluder/coveralls/maven/plugin/source/UrlSourceLoaderTest.java
class UrlSourceLoaderTest (line 44) | @RunWith(MockitoJUnitRunner.class)
method testMissingSourceFileFromUrl (line 56) | @Test
method testLoadSourceFromUrl (line 62) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/util/CoverageParsersFactoryTest.java
class CoverageParsersFactoryTest (line 56) | @RunWith(MockitoJUnitRunner.class)
method init (line 81) | @Before
method testCreateEmptyParsers (line 93) | @Test(expected = IOException.class)
method testCreateJaCoCoParser (line 98) | @Test
method testCreateCoberturaParser (line 107) | @Test
method testCreateSagaParser (line 116) | @Test
method testWithJaCoCoReport (line 125) | @Test
method testWithCoberturaReport (line 135) | @Test
method testWithSagaReport (line 145) | @Test
method testWithRelativeReportDirectory (line 155) | @Test
method testWithRootRelativeReportDirectory (line 165) | @Test
method createCoverageParsersFactory (line 174) | private CoverageParsersFactory createCoverageParsersFactory() {
FILE: src/test/java/org/eluder/coveralls/maven/plugin/util/ExistingFilesTest.java
class ExistingFilesTest (line 39) | public class ExistingFilesTest {
method testAddAllForNull (line 45) | @Test(expected = NullPointerException.class)
method testAddForNull (line 50) | @Test(expected = NullPointerException.class)
method testAddForExisting (line 55) | @Test
method testAddForDirectory (line 62) | @Test
method testCreateForNull (line 69) | @Test
method testCreateForMultipleFiles (line 75) | @Test
method assertSize (line 83) | private static void assertSize(Iterator<?> iter, int size) {
FILE: src/test/java/org/eluder/coveralls/maven/plugin/util/Md5DigestInputStreamTest.java
class Md5DigestInputStreamTest (line 35) | public class Md5DigestInputStreamTest {
method testRead (line 37) | @Test
method testReadArray (line 50) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/util/SourceLoaderFactoryTest.java
class SourceLoaderFactoryTest (line 46) | @RunWith(MockitoJUnitRunner.class)
method init (line 65) | @Before
method testCreateSourceLoader (line 78) | @Test
method testCreateSourceLoaderWithAdditionalSourceDirectories (line 84) | @Test
method testCreateSourceLoaderWithScanForSources (line 94) | @Test
method testCreateSourceLoaderInvalidDirectory (line 102) | @Test
method createSourceLoaderFactory (line 113) | private SourceLoaderFactory createSourceLoaderFactory(String sourceEnc...
FILE: src/test/java/org/eluder/coveralls/maven/plugin/util/TestIoUtil.java
class TestIoUtil (line 42) | public class TestIoUtil {
method writeFileContent (line 44) | public static void writeFileContent(final String content, final File f...
method readFileContent (line 53) | public static String readFileContent(final File file) throws IOExcepti...
method getFile (line 62) | public static File getFile(final String resource) {
method getMd5DigestHex (line 77) | public static String getMd5DigestHex(final String content) throws NoSu...
method getResourceUrl (line 81) | private static URL getResourceUrl(final String resource) {
FILE: src/test/java/org/eluder/coveralls/maven/plugin/util/TimestampParserTest.java
class TimestampParserTest (line 38) | public class TimestampParserTest {
method testInvalidFormat (line 40) | @Test(expected = IllegalArgumentException.class)
method testParseEpochMillis (line 45) | @Test
method testParseSimpleFormat (line 54) | @Test
method testParseDefaultFormat (line 63) | @Test
method testParseNull (line 72) | @Test
method testParseInvalidTimestamp (line 79) | @Test(expected = ProcessingException.class)
FILE: src/test/java/org/eluder/coveralls/maven/plugin/util/UrlUtilsTest.java
class UrlUtilsTest (line 36) | public class UrlUtilsTest {
method testCreateInvalidUrl (line 38) | @Test(expected = IllegalArgumentException.class)
method testCreateValidUrl (line 43) | @Test
method testInvalidUrlToUri (line 48) | @Test(expected = IllegalArgumentException.class)
method testValidUrlToUri (line 53) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/util/WildcardsTest.java
class WildcardsTest (line 34) | public class WildcardsTest {
method testMatchesAgainstNull (line 36) | @Test
method testMatchesAgainstJoker (line 41) | @Test
method testMatchesAgainstStar (line 46) | @Test
method testMatchesAgainstWildcards (line 51) | @Test
method testMatchesAgainstText (line 57) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/validation/JobValidatorTest.java
class JobValidatorTest (line 40) | public class JobValidatorTest {
method testMissingJob (line 42) | @Test(expected = IllegalArgumentException.class)
method testValidateWithoutRepoTokenOrTravis (line 47) | @Test
method testValidateWithoutRepoTokenOrTravisForDryRun (line 54) | @Test
method testValidateWithInvalidTravis (line 61) | @Test
method testValidateWithRepoToken (line 68) | @Test
method testValidateWithTravis (line 74) | @Test
method testValidateWithoutGitCommitId (line 80) | @Test
method testValidateWithGit (line 88) | @Test
method testValidateWithParallel (line 95) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/validation/ValidationErrorTest.java
class ValidationErrorTest (line 34) | public class ValidationErrorTest {
method testMissingLevel (line 36) | @Test(expected = IllegalArgumentException.class)
method testMissingMessage (line 41) | @Test(expected = IllegalArgumentException.class)
method testToString (line 46) | @Test
FILE: src/test/java/org/eluder/coveralls/maven/plugin/validation/ValidationErrorsTest.java
class ValidationErrorsTest (line 40) | @RunWith(MockitoJUnitRunner.class)
method testThrowOrInformWithError (line 46) | @Test(expected = ValidationException.class)
method testThrowOrInformWithWarnings (line 51) | @Test
method createValidationErrors (line 57) | private ValidationErrors createValidationErrors(final ValidationError....
FILE: src/test/java/org/eluder/coveralls/maven/plugin/validation/ValidationExceptionTest.java
class ValidationExceptionTest (line 35) | public class ValidationExceptionTest {
method testException (line 40) | @Test
method testExceptionWithMessage (line 47) | @Test
method testExceptionWithCause (line 54) | @Test
method testExceptionWithMessageAndCause (line 61) | @Test
FILE: src/test/resources/InnerClassCoverage.java
class InnerClassCoverage (line 3) | public class InnerClassCoverage {
method anonymous (line 5) | public void anonymous() {
method delegate (line 15) | public boolean delegate() {
class InnerClass (line 19) | public static class InnerClass {
method isInner (line 21) | public boolean isInner() {
method run (line 25) | public void run() {
FILE: src/test/resources/Localization.js
function Localization (line 5) | function Localization(values) {
FILE: src/test/resources/PartialCoverage.java
class PartialCoverage (line 3) | public class PartialCoverage {
method partial (line 5) | public void partial(boolean test) {
FILE: src/test/resources/SimpleCoverage.java
class SimpleCoverage (line 3) | public class SimpleCoverage {
method isTested (line 5) | public boolean isTested() {
method neverRun (line 9) | public void neverRun() {
Condensed preview — 134 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (449K chars).
[
{
"path": ".gitignore",
"chars": 114,
"preview": "target\ntarget/*\n\n# Eclipse\n.settings\n.project\n.classpath\n\n# Idea\n*.iml\n.idea\n\n# Atlassian\natlassian-ide-plugin.xml"
},
{
"path": ".gitmodules",
"chars": 72,
"preview": "[submodule \"etc\"]\n\tpath = etc\n\turl = git://github.com/trautonen/etc.git\n"
},
{
"path": ".travis.yml",
"chars": 819,
"preview": "dist: xenial\n\nlanguage: java\n\nsudo: false\n\njdk:\n - openjdk8\n - openjdk10\n - openjdk11\n\nenv:\n global:\n - secure: \""
},
{
"path": "CHANGELOG.md",
"chars": 2311,
"preview": "# Changelog\n\n## 4.2.0\n\n- #95, #96: Improved error message for misbehaving Coveralls API\n- #92: Support for HTTP proxies "
},
{
"path": "LICENSE.MIT",
"chars": 1089,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2013 - 2016, Tapio Rautonen\n\nPermission is hereby granted, free of charge, to any p"
},
{
"path": "MIGRATION.md",
"chars": 1317,
"preview": "# Migration guide\n\nChanges marked with bold affect the plugin usage. Other changes are only related to development\nand c"
},
{
"path": "README.md",
"chars": 16426,
"preview": "coveralls-maven-plugin\n======================\n\n[](http://u"
},
{
"path": "README_2_x.md",
"chars": 16028,
"preview": "coveralls-maven-plugin\n======================\n\n[ {\n InnerClass"
},
{
"path": "sample/module1/src/main/java/org/eluder/coverage/sample/SimpleCoverage.java",
"chars": 211,
"preview": "package org.eluder.coverage.sample;\n\npublic class SimpleCoverage {\n\n public boolean isTested() {\n return false"
},
{
"path": "sample/module1/src/main/resources/Components.js",
"chars": 54,
"preview": "(function() {\n this.Components = {};\n\n}).call(this);\n"
},
{
"path": "sample/module1/src/main/resources/Localization.js",
"chars": 277,
"preview": "(function() {\n var Localization;\n\n Localization = (function() {\n function Localization(values) {\n this.values "
},
{
"path": "sample/module1/src/test/java/org/eluder/coverage/sample/InnerClassCoverageTest.java",
"chars": 302,
"preview": "package org.eluder.coverage.sample;\n\nimport org.junit.Test;\n\npublic class InnerClassCoverageTest {\n\n @Test\n public"
},
{
"path": "sample/module1/src/test/java/org/eluder/coverage/sample/SimpleCoverageTest.java",
"chars": 185,
"preview": "package org.eluder.coverage.sample;\n\nimport org.junit.Test;\n\npublic class SimpleCoverageTest {\n\n @Test\n public voi"
},
{
"path": "sample/module1/src/test/specs/ComponentsSpec.coffee",
"chars": 135,
"preview": "describe 'Components testing', ->\n\n it 'Components object on window not null', ->\n\n expect(window.Components)."
},
{
"path": "sample/module2/pom.xml",
"chars": 551,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www"
},
{
"path": "sample/module2/src/main/java/org/eluder/coverage/sample/PartialCoverage.java",
"chars": 257,
"preview": "package org.eluder.coverage.sample;\n\npublic class PartialCoverage {\n \n public void partial(boolean test) {\n "
},
{
"path": "sample/module2/src/test/java/org/eluder/coverage/sample/PartialCoverageIT.java",
"chars": 188,
"preview": "package org.eluder.coverage.sample;\n\nimport org.junit.Test;\n\npublic class PartialCoverageIT {\n\n @Test\n public void"
},
{
"path": "sample/module2/src/test/java/org/eluder/coverage/sample/PartialCoverageTest.java",
"chars": 197,
"preview": "package org.eluder.coverage.sample;\n\nimport org.junit.Test;\n\npublic class PartialCoverageTest {\n\n @Test\n public vo"
},
{
"path": "sample/pom.xml",
"chars": 5498,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www"
},
{
"path": "scripts/bump-version.sh",
"chars": 1051,
"preview": "#!/bin/bash\n\nif [ $# -ne 1 ]\nthen\n echo \"Invalid number of arguments\"\n echo \"USAGE: $0 <version>\"\n exit 1\nfi\n\nv"
},
{
"path": "scripts/functions.sh",
"chars": 155,
"preview": "#!/bin/bash\n\ncontains_files()\n{\n for file in \"$@\"\n do\n if ! [ -f $file ]\n then\n return 1\n"
},
{
"path": "scripts/release.sh",
"chars": 2082,
"preview": "#!/bin/bash\n\nscript_dir=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\nworking_dir=\"$( pwd )\"\nfiles=( \"pom.xml\" \"RE"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/CoverageParser.java",
"chars": 2270,
"preview": "package org.eluder.coveralls.maven.plugin;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 - 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/CoverallsReportMojo.java",
"chars": 16465,
"preview": "package org.eluder.coveralls.maven.plugin;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 - 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/Environment.java",
"chars": 4104,
"preview": "package org.eluder.coveralls.maven.plugin;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 - 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/ProcessingException.java",
"chars": 1715,
"preview": "package org.eluder.coveralls.maven.plugin;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 - 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/domain/Branch.java",
"chars": 1977,
"preview": "package org.eluder.coveralls.maven.plugin.domain;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/domain/CoverallsResponse.java",
"chars": 2010,
"preview": "package org.eluder.coveralls.maven.plugin.domain;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/domain/Git.java",
"chars": 4232,
"preview": "package org.eluder.coveralls.maven.plugin.domain;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/domain/GitRepository.java",
"chars": 3357,
"preview": "package org.eluder.coveralls.maven.plugin.domain;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/domain/Job.java",
"chars": 4842,
"preview": "package org.eluder.coveralls.maven.plugin.domain;\n\nimport java.util.Date;\nimport java.util.Properties;\n\nimport org.elude"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/domain/JsonObject.java",
"chars": 1579,
"preview": "package org.eluder.coveralls.maven.plugin.domain;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/domain/Source.java",
"chars": 6975,
"preview": "package org.eluder.coveralls.maven.plugin.domain;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/httpclient/CoverallsClient.java",
"chars": 5490,
"preview": "package org.eluder.coveralls.maven.plugin.httpclient;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C)"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/httpclient/CoverallsProxyClient.java",
"chars": 1598,
"preview": "package org.eluder.coveralls.maven.plugin.httpclient;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C)"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/httpclient/HttpClientFactory.java",
"chars": 3666,
"preview": "package org.eluder.coveralls.maven.plugin.httpclient;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C)"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/json/JsonWriter.java",
"chars": 5928,
"preview": "package org.eluder.coveralls.maven.plugin.json;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 "
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/logging/CoverageTracingLogger.java",
"chars": 3873,
"preview": "package org.eluder.coveralls.maven.plugin.logging;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/logging/DryRunLogger.java",
"chars": 2110,
"preview": "package org.eluder.coveralls.maven.plugin.logging;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/logging/JobLogger.java",
"chars": 4193,
"preview": "package org.eluder.coveralls.maven.plugin.logging;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/logging/Logger.java",
"chars": 1684,
"preview": "package org.eluder.coveralls.maven.plugin.logging;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/parser/AbstractXmlEventParser.java",
"chars": 4637,
"preview": "package org.eluder.coveralls.maven.plugin.parser;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/parser/CoberturaParser.java",
"chars": 4495,
"preview": "package org.eluder.coveralls.maven.plugin.parser;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/parser/JaCoCoParser.java",
"chars": 3677,
"preview": "package org.eluder.coveralls.maven.plugin.parser;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/parser/SagaParser.java",
"chars": 2185,
"preview": "package org.eluder.coveralls.maven.plugin.parser;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/service/AbstractServiceSetup.java",
"chars": 2520,
"preview": "package org.eluder.coveralls.maven.plugin.service;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/service/Appveyor.java",
"chars": 2861,
"preview": "package org.eluder.coveralls.maven.plugin.service;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/service/Bamboo.java",
"chars": 2310,
"preview": "package org.eluder.coveralls.maven.plugin.service;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/service/Circle.java",
"chars": 2599,
"preview": "package org.eluder.coveralls.maven.plugin.service;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/service/General.java",
"chars": 2435,
"preview": "package org.eluder.coveralls.maven.plugin.service;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/service/Jenkins.java",
"chars": 2870,
"preview": "package org.eluder.coveralls.maven.plugin.service;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/service/ServiceSetup.java",
"chars": 2285,
"preview": "package org.eluder.coveralls.maven.plugin.service;\n\nimport java.util.Properties;\n\n/*\n * #[license]\n * coveralls-maven-pl"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/service/Shippable.java",
"chars": 3317,
"preview": "package org.eluder.coveralls.maven.plugin.service;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/service/Travis.java",
"chars": 2644,
"preview": "package org.eluder.coveralls.maven.plugin.service;\n\nimport java.util.Map;\nimport java.util.Properties;\n\n/*\n * #[license]"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/service/Wercker.java",
"chars": 2296,
"preview": "package org.eluder.coveralls.maven.plugin.service;\n\nimport java.util.Map;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n *"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/source/AbstractSourceLoader.java",
"chars": 2973,
"preview": "package org.eluder.coveralls.maven.plugin.source;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/source/ChainingSourceCallback.java",
"chars": 3269,
"preview": "package org.eluder.coveralls.maven.plugin.source;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/source/DirectorySourceLoader.java",
"chars": 2163,
"preview": "package org.eluder.coveralls.maven.plugin.source;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/source/MultiSourceLoader.java",
"chars": 2026,
"preview": "package org.eluder.coveralls.maven.plugin.source;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/source/ScanSourceLoader.java",
"chars": 3345,
"preview": "package org.eluder.coveralls.maven.plugin.source;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/source/SourceCallback.java",
"chars": 2285,
"preview": "package org.eluder.coveralls.maven.plugin.source;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/source/SourceLoader.java",
"chars": 1428,
"preview": "package org.eluder.coveralls.maven.plugin.source;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/source/UniqueSourceCallback.java",
"chars": 2585,
"preview": "package org.eluder.coveralls.maven.plugin.source;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/source/UrlSourceLoader.java",
"chars": 2072,
"preview": "package org.eluder.coveralls.maven.plugin.source;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/util/CoverageParsersFactory.java",
"chars": 6053,
"preview": "package org.eluder.coveralls.maven.plugin.util;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 "
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/util/ExistingFiles.java",
"chars": 2360,
"preview": "package org.eluder.coveralls.maven.plugin.util;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 "
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/util/MavenProjectCollector.java",
"chars": 1990,
"preview": "package org.eluder.coveralls.maven.plugin.util;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 "
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/util/Md5DigestInputStream.java",
"chars": 1771,
"preview": "package org.eluder.coveralls.maven.plugin.util;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 "
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/util/SourceLoaderFactory.java",
"chars": 3737,
"preview": "package org.eluder.coveralls.maven.plugin.util;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 "
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/util/TimestampParser.java",
"chars": 3274,
"preview": "package org.eluder.coveralls.maven.plugin.util;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 "
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/util/UrlUtils.java",
"chars": 1867,
"preview": "package org.eluder.coveralls.maven.plugin.util;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 "
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/util/Wildcards.java",
"chars": 1911,
"preview": "package org.eluder.coveralls.maven.plugin.util;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 "
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/validation/JobValidator.java",
"chars": 2932,
"preview": "package org.eluder.coveralls.maven.plugin.validation;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C)"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/validation/ValidationError.java",
"chars": 1998,
"preview": "package org.eluder.coveralls.maven.plugin.validation;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C)"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/validation/ValidationErrors.java",
"chars": 2141,
"preview": "package org.eluder.coveralls.maven.plugin.validation;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C)"
},
{
"path": "src/main/java/org/eluder/coveralls/maven/plugin/validation/ValidationException.java",
"chars": 1655,
"preview": "package org.eluder.coveralls.maven.plugin.validation;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C)"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/CoverageFixture.java",
"chars": 3304,
"preview": "package org.eluder.coveralls.maven.plugin;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 - 201"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/CoverallsReportMojoTest.java",
"chars": 11943,
"preview": "package org.eluder.coveralls.maven.plugin;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 - 201"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/EnvironmentTest.java",
"chars": 6561,
"preview": "package org.eluder.coveralls.maven.plugin;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 - 201"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/ProcessingExceptionTest.java",
"chars": 2516,
"preview": "package org.eluder.coveralls.maven.plugin;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 - 201"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/domain/GitRepositoryTest.java",
"chars": 1671,
"preview": "package org.eluder.coveralls.maven.plugin.domain;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/domain/JobTest.java",
"chars": 2108,
"preview": "package org.eluder.coveralls.maven.plugin.domain;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/domain/SourceTest.java",
"chars": 7577,
"preview": "package org.eluder.coveralls.maven.plugin.domain;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/httpclient/CoverallsClientTest.java",
"chars": 7616,
"preview": "package org.eluder.coveralls.maven.plugin.httpclient;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C)"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/httpclient/CoverallsProxyClientTest.java",
"chars": 1833,
"preview": "package org.eluder.coveralls.maven.plugin.httpclient;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C)"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/httpclient/HttpClientFactoryTest.java",
"chars": 4783,
"preview": "package org.eluder.coveralls.maven.plugin.httpclient;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C)"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/json/JsonWriterTest.java",
"chars": 6307,
"preview": "package org.eluder.coveralls.maven.plugin.json;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 "
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/logging/CoverageTracingLoggerTest.java",
"chars": 4660,
"preview": "package org.eluder.coveralls.maven.plugin.logging;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/logging/DryRunLoggerTest.java",
"chars": 2803,
"preview": "package org.eluder.coveralls.maven.plugin.logging;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/logging/JobLoggerTest.java",
"chars": 5509,
"preview": "package org.eluder.coveralls.maven.plugin.logging;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/parser/AbstractCoverageParserTest.java",
"chars": 7957,
"preview": "package org.eluder.coveralls.maven.plugin.parser;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/parser/CoberturaParserTest.java",
"chars": 1994,
"preview": "package org.eluder.coveralls.maven.plugin.parser;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/parser/JaCoCoParserTest.java",
"chars": 2026,
"preview": "package org.eluder.coveralls.maven.plugin.parser;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/parser/SagaParserTest.java",
"chars": 2032,
"preview": "package org.eluder.coveralls.maven.plugin.parser;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/service/AbstractServiceSetupTest.java",
"chars": 3487,
"preview": "package org.eluder.coveralls.maven.plugin.service;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/service/AppveyorTest.java",
"chars": 2919,
"preview": "package org.eluder.coveralls.maven.plugin.service;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/service/BambooTest.java",
"chars": 2578,
"preview": "package org.eluder.coveralls.maven.plugin.service;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/service/CircleTest.java",
"chars": 2831,
"preview": "package org.eluder.coveralls.maven.plugin.service;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/service/GeneralTest.java",
"chars": 2741,
"preview": "package org.eluder.coveralls.maven.plugin.service;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/service/JenkinsTest.java",
"chars": 3181,
"preview": "package org.eluder.coveralls.maven.plugin.service;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/service/ShippableTest.java",
"chars": 3594,
"preview": "package org.eluder.coveralls.maven.plugin.service;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/service/TravisTest.java",
"chars": 2875,
"preview": "package org.eluder.coveralls.maven.plugin.service;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/service/WerckerTest.java",
"chars": 2597,
"preview": "package org.eluder.coveralls.maven.plugin.service;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 20"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/source/DirectorySourceLoaderTest.java",
"chars": 3026,
"preview": "package org.eluder.coveralls.maven.plugin.source;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/source/MultiSourceLoaderTest.java",
"chars": 2616,
"preview": "package org.eluder.coveralls.maven.plugin.source;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/source/ScanSourceLoaderTest.java",
"chars": 3495,
"preview": "package org.eluder.coveralls.maven.plugin.source;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/source/UniqueSourceCallbackTest.java",
"chars": 3880,
"preview": "package org.eluder.coveralls.maven.plugin.source;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/source/UrlSourceLoaderTest.java",
"chars": 2915,
"preview": "package org.eluder.coveralls.maven.plugin.source;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 201"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/util/CoverageParsersFactoryTest.java",
"chars": 7317,
"preview": "package org.eluder.coveralls.maven.plugin.util;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 "
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/util/ExistingFilesTest.java",
"chars": 2904,
"preview": "package org.eluder.coveralls.maven.plugin.util;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 "
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/util/Md5DigestInputStreamTest.java",
"chars": 2531,
"preview": "package org.eluder.coveralls.maven.plugin.util;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 "
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/util/SourceLoaderFactoryTest.java",
"chars": 4378,
"preview": "package org.eluder.coveralls.maven.plugin.util;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 "
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/util/TestIoUtil.java",
"chars": 3072,
"preview": "package org.eluder.coveralls.maven.plugin.util;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 "
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/util/TimestampParserTest.java",
"chars": 2933,
"preview": "package org.eluder.coveralls.maven.plugin.util;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 "
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/util/UrlUtilsTest.java",
"chars": 2090,
"preview": "package org.eluder.coveralls.maven.plugin.util;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 "
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/util/WildcardsTest.java",
"chars": 2155,
"preview": "package org.eluder.coveralls.maven.plugin.util;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C) 2013 "
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/validation/JobValidatorTest.java",
"chars": 4000,
"preview": "package org.eluder.coveralls.maven.plugin.validation;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C)"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/validation/ValidationErrorTest.java",
"chars": 1910,
"preview": "package org.eluder.coveralls.maven.plugin.validation;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C)"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/validation/ValidationErrorsTest.java",
"chars": 2508,
"preview": "package org.eluder.coveralls.maven.plugin.validation;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C)"
},
{
"path": "src/test/java/org/eluder/coveralls/maven/plugin/validation/ValidationExceptionTest.java",
"chars": 2526,
"preview": "package org.eluder.coveralls.maven.plugin.validation;\n\n/*\n * #[license]\n * coveralls-maven-plugin\n * %%\n * Copyright (C)"
},
{
"path": "src/test/resources/Components.js",
"chars": 54,
"preview": "(function() {\n this.Components = {};\n\n}).call(this);\n"
},
{
"path": "src/test/resources/InnerClassCoverage.java",
"chars": 574,
"preview": "package org.eluder.coverage.sample;\n\npublic class InnerClassCoverage {\n\n public void anonymous() {\n InnerClass"
},
{
"path": "src/test/resources/Localization.js",
"chars": 277,
"preview": "(function() {\n var Localization;\n\n Localization = (function() {\n function Localization(values) {\n this.values "
},
{
"path": "src/test/resources/PartialCoverage.java",
"chars": 249,
"preview": "package org.eluder.coverage.sample;\n\npublic class PartialCoverage {\n\n public void partial(boolean test) {\n if "
},
{
"path": "src/test/resources/SimpleCoverage.java",
"chars": 203,
"preview": "package org.eluder.coverage.sample;\n\npublic class SimpleCoverage {\n\n public boolean isTested() {\n return false"
},
{
"path": "src/test/resources/cobertura.xml",
"chars": 6291,
"preview": "<?xml version=\"1.0\"?>\n<!DOCTYPE coverage SYSTEM \"http://cobertura.sourceforge.net/xml/coverage-04.dtd\">\n\n<coverage line-"
},
{
"path": "src/test/resources/jacoco1.xml",
"chars": 6027,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><!DOCTYPE report PUBLIC \"-//JACOCO//DTD Report 1.0//EN\" \"report.d"
},
{
"path": "src/test/resources/jacoco2-it.xml",
"chars": 3478,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n<!--\n #[license]\n coveralls-maven-plugin\n %%\n Copyright (C) "
},
{
"path": "src/test/resources/jacoco2.xml",
"chars": 2308,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><!DOCTYPE report PUBLIC \"-//JACOCO//DTD Report 1.0//EN\" \"report.d"
},
{
"path": "src/test/resources/saga.xml",
"chars": 1809,
"preview": "<?xml version=\"1.0\" ?>\n<!DOCTYPE coverage SYSTEM 'http://cobertura.sourceforge.net/xml/coverage-04.dtd'>\n<!-- Generated "
}
]
About this extraction
This page contains the full source code of the trautonen/coveralls-maven-plugin GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 134 files (410.1 KB), approximately 99.1k tokens, and a symbol index with 702 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.