Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: trautonen/coveralls-maven-plugin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.0.0
Choose a base ref
...
head repository: trautonen/coveralls-maven-plugin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.1.0
Choose a head ref
  • 17 commits
  • 11 files changed
  • 3 contributors

Commits on Aug 26, 2015

  1. Verified

    This commit was signed with the committer’s verified signature.
    renovate-bot Mend Renovate
    Copy the full SHA
    d19bd92 View commit details

Commits on Aug 27, 2015

  1. Updated credits.

    trautonen committed Aug 27, 2015
    Copy the full SHA
    6e8532b View commit details
  2. Added requirements.

    trautonen committed Aug 27, 2015
    Copy the full SHA
    1fd6dae View commit details
  3. Copy the full SHA
    797c465 View commit details
  4. Changelog for 4.0.0.

    trautonen committed Aug 27, 2015
    Copy the full SHA
    abcfd5f View commit details
  5. Copy the full SHA
    69fa42e View commit details

Commits on Nov 28, 2015

  1. Added Appveyor support

    velo committed Nov 28, 2015
    Copy the full SHA
    5c45ef6 View commit details
  2. Merge pull request #88 from velo/coveralls

    Added Appveyor support.
    trautonen committed Nov 28, 2015
    Copy the full SHA
    70d10fa View commit details
  3. Flat badges.

    trautonen committed Nov 28, 2015
    Copy the full SHA
    f5f1059 View commit details
  4. Copy the full SHA
    dd805d9 View commit details
  5. Copy the full SHA
    1fa9a47 View commit details
  6. Cleanup old jdks.

    trautonen committed Nov 28, 2015
    Copy the full SHA
    b6c1e3a View commit details
  7. Install pyyaml.

    trautonen committed Nov 28, 2015
    Copy the full SHA
    9972641 View commit details
  8. Copy the full SHA
    8053e75 View commit details
  9. Copy the full SHA
    867d44d View commit details
  10. Copy the full SHA
    b82e3db View commit details
  11. Updated to version 4.1.0.

    trautonen committed Nov 28, 2015
    Copy the full SHA
    f52822b View commit details
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -4,14 +4,17 @@ sudo: false

jdk:
- oraclejdk7
# - openjdk7
# - openjdk6

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

8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 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.0

- #82: Improved error message for duplicate classes in different modules
32 changes: 21 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
coveralls-maven-plugin
======================

[![Build Status](http://img.shields.io/travis/trautonen/coveralls-maven-plugin/master.svg)](https://travis-ci.org/trautonen/coveralls-maven-plugin)
[![Coverage Status](http://img.shields.io/coveralls/trautonen/coveralls-maven-plugin/master.svg)](https://coveralls.io/r/trautonen/coveralls-maven-plugin?branch=master)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.eluder.coveralls/coveralls-maven-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.eluder.coveralls/coveralls-maven-plugin/)
[![Build Status](http://img.shields.io/travis/trautonen/coveralls-maven-plugin/master.svg?style=flat-square)](https://travis-ci.org/trautonen/coveralls-maven-plugin)
[![Coverage Status](http://img.shields.io/coveralls/trautonen/coveralls-maven-plugin/master.svg?style=flat-square)](https://coveralls.io/r/trautonen/coveralls-maven-plugin?branch=master)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.eluder.coveralls/coveralls-maven-plugin/badge.svg?style=flat-square)](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.

### Requirements

* Java 6 up to 3.x and Java 7 for 4.x onwards.
* Maven 3.0.0 or newer.


### Features

@@ -17,7 +22,8 @@ service.
* 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/) and [Shippable](https://www.shippable.com/) continuous integration services
[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
@@ -32,7 +38,7 @@ Set up the Coveralls maven plugin in the build section of the project pom.xml:
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>4.0.0</version>
<version>4.1.0</version>
<configuration>
<repoToken>yourcoverallsprojectrepositorytoken</repoToken>
</configuration>
@@ -66,7 +72,7 @@ pom.xml:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.6</version>
<version>2.7</version>
<configuration>
<format>xml</format>
<maxmem>256m</maxmem>
@@ -98,7 +104,7 @@ Set up the JaCoCo Maven plugin in the build section of the project pom.xml:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.2.201409121644</version>
<version>0.7.5.201505241946</version>
<executions>
<execution>
<id>prepare-agent</id>
@@ -132,7 +138,7 @@ Set up the Saga Maven plugin in the build section of the project pom.xml:
<plugin>
<groupId>com.github.timurstrekalov</groupId>
<artifactId>saga-maven-plugin</artifactId>
<version>1.5.2</version>
<version>1.5.5</version>
<executions>
<execution>
<goals>
@@ -145,6 +151,8 @@ Set up the Saga Maven plugin in the build section of the project pom.xml:
<outputDir>${project.build.directory}/saga-coverage</outputDir>
<noInstrumentPatterns>
<pattern>.*/spec/.*</pattern>
<pattern>.*/classpath/.*</pattern>
<pattern>.*/webjars/.*</pattern>
</noInstrumentPatterns>
</configuration>
</plugin>
@@ -215,7 +223,8 @@ service environment will not override it.
| `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. |
| `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. |
@@ -309,8 +318,9 @@ See [migration](MIGRATION.md) documentation for more information.
- Jakub Bednář (@bednar) for Saga integration and the idea of chaining multiple reports provided
by different coverage tools.
- Marvin Froeder (@velo) for Shippable support, configurable basedir and directory scanning source
loader.
- 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
2 changes: 1 addition & 1 deletion etc
Submodule etc updated 3 files
+7 −1 .gitignore
+8 −0 README.md
+21 −6 travis-build.py
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@

<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>4.0.0</version>
<version>4.1.0</version>
<packaging>maven-plugin</packaging>

<name>coveralls-maven-plugin</name>
2 changes: 1 addition & 1 deletion sample/pom.xml
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
<maven.jacoco.version>0.7.5.201505241946</maven.jacoco.version>
<maven.cobertura.version>2.7</maven.cobertura.version>
<maven.jasmine.version>2.0</maven.jasmine.version>
<maven.saga.version>1.5.4</maven.saga.version>
<maven.saga.version>1.5.5</maven.saga.version>
</properties>

<modules>
Original file line number Diff line number Diff line change
@@ -44,6 +44,7 @@
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;
@@ -296,6 +297,7 @@ protected List<ServiceSetup> getServices() {
services.add(new Circle(env));
services.add(new Jenkins(env));
services.add(new Bamboo(env));
services.add(new Appveyor(env));
services.add(new General(env));
return services;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
package org.eluder.coveralls.maven.plugin.service;

/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2015 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);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package org.eluder.coveralls.maven.plugin.service;

/*
* #[license]
* coveralls-maven-plugin
* %%
* Copyright (C) 2013 - 2015 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.junit.Test;

import java.util.HashMap;
import java.util.Map;

import static org.junit.Assert.*;

public class AppveyorTest {

private Map<String, String> env() {
Map<String, String> env = new HashMap<String, String>();
env.put(Appveyor.APPVEYOR, "true");
env.put(Appveyor.APPVEYOR_BUILD_ID, "54de3316c44f");
env.put(Appveyor.APPVEYOR_BUILD_NUMBER, "77");
env.put(Appveyor.APPVEYOR_BRANCH, "master");
env.put(Appveyor.APPVEYOR_COMMIT, "a3562fgcd2");
env.put(Appveyor.APPVEYOR_PULL_REQUEST, "10");
env.put(Appveyor.APPVEYOR_REPO_NAME, "owner/project");
return env;
}

@Test
public void testIsSelectedForNothing() {
assertFalse(new Appveyor(new HashMap<String, String>()).isSelected());
}

@Test
public void testIsSelectedForAppveyor() {
assertTrue(new Appveyor(env()).isSelected());
}

@Test
public void testGetName() {
assertEquals("Appveyor", new Appveyor(env()).getName());
}

@Test
public void testGetBuildNumber() {
assertEquals("77", new Appveyor(env()).getBuildNumber());
}

@Test
public void testGetBuildUrl() {
assertEquals("https://ci.appveyor.com/project/owner/project/build/77", new Appveyor(env()).getBuildUrl());
}

@Test
public void testGetBranch() {
assertEquals("master", new Appveyor(env()).getBranch());
}

@Test
public void testPullRequest() {
assertEquals("10", new Appveyor(env()).getPullRequest());
}

@Test
public void testGetJobId() {
assertEquals("54de3316c44f", new Appveyor(env()).getJobId());
}
}
Original file line number Diff line number Diff line change
@@ -71,4 +71,4 @@ public void testParseNull() throws Exception {
public void testParseInvalidTimestamp() throws Exception {
new TimestampParser(null).parse("2015-08-20");
}
}
}
2 changes: 1 addition & 1 deletion src/test/resources/jacoco2-it.xml
Original file line number Diff line number Diff line change
@@ -24,4 +24,4 @@
THE SOFTWARE.
%[license]
-->
<!DOCTYPE report PUBLIC "-//JACOCO//DTD Report 1.0//EN" "report.dtd"><report name="module2"><sessioninfo id="test" start="1440276758209" dump="1440276758651"/><package name="org/eluder/coverage/sample"><class name="org/eluder/coverage/sample/PartialCoverage"><method name="&lt;init&gt;" desc="()V" line="3"><counter type="INSTRUCTION" missed="0" covered="3"/><counter type="LINE" missed="0" covered="1"/><counter type="COMPLEXITY" missed="0" covered="1"/><counter type="METHOD" missed="0" covered="1"/></method><method name="partial" desc="(Z)V" line="6"><counter type="INSTRUCTION" missed="4" covered="6"/><counter type="BRANCH" missed="1" covered="1"/><counter type="LINE" missed="1" covered="3"/><counter type="COMPLEXITY" missed="1" covered="1"/><counter type="METHOD" missed="0" covered="1"/></method><counter type="INSTRUCTION" missed="4" covered="9"/><counter type="BRANCH" missed="1" covered="1"/><counter type="LINE" missed="1" covered="4"/><counter type="COMPLEXITY" missed="1" covered="2"/><counter type="METHOD" missed="0" covered="2"/><counter type="CLASS" missed="0" covered="1"/></class><sourcefile name="PartialCoverage.java"><line nr="3" mi="0" ci="3" mb="0" cb="0"/><line nr="6" mi="0" ci="2" mb="1" cb="1"/><line nr="7" mi="4" ci="0" mb="0" cb="0"/><line nr="9" mi="0" ci="3" mb="0" cb="0"/><line nr="11" mi="0" ci="1" mb="0" cb="0"/><counter type="INSTRUCTION" missed="4" covered="9"/><counter type="BRANCH" missed="1" covered="1"/><counter type="LINE" missed="1" covered="4"/><counter type="COMPLEXITY" missed="1" covered="2"/><counter type="METHOD" missed="0" covered="2"/><counter type="CLASS" missed="0" covered="1"/></sourcefile><counter type="INSTRUCTION" missed="4" covered="9"/><counter type="BRANCH" missed="1" covered="1"/><counter type="LINE" missed="1" covered="4"/><counter type="COMPLEXITY" missed="1" covered="2"/><counter type="METHOD" missed="0" covered="2"/><counter type="CLASS" missed="0" covered="1"/></package><counter type="INSTRUCTION" missed="4" covered="9"/><counter type="BRANCH" missed="1" covered="1"/><counter type="LINE" missed="1" covered="4"/><counter type="COMPLEXITY" missed="1" covered="2"/><counter type="METHOD" missed="0" covered="2"/><counter type="CLASS" missed="0" covered="1"/></report>
<!DOCTYPE report PUBLIC "-//JACOCO//DTD Report 1.0//EN" "report.dtd"><report name="module2"><sessioninfo id="test" start="1440276758209" dump="1440276758651"/><package name="org/eluder/coverage/sample"><class name="org/eluder/coverage/sample/PartialCoverage"><method name="&lt;init&gt;" desc="()V" line="3"><counter type="INSTRUCTION" missed="0" covered="3"/><counter type="LINE" missed="0" covered="1"/><counter type="COMPLEXITY" missed="0" covered="1"/><counter type="METHOD" missed="0" covered="1"/></method><method name="partial" desc="(Z)V" line="6"><counter type="INSTRUCTION" missed="4" covered="6"/><counter type="BRANCH" missed="1" covered="1"/><counter type="LINE" missed="1" covered="3"/><counter type="COMPLEXITY" missed="1" covered="1"/><counter type="METHOD" missed="0" covered="1"/></method><counter type="INSTRUCTION" missed="4" covered="9"/><counter type="BRANCH" missed="1" covered="1"/><counter type="LINE" missed="1" covered="4"/><counter type="COMPLEXITY" missed="1" covered="2"/><counter type="METHOD" missed="0" covered="2"/><counter type="CLASS" missed="0" covered="1"/></class><sourcefile name="PartialCoverage.java"><line nr="3" mi="0" ci="3" mb="0" cb="0"/><line nr="6" mi="0" ci="2" mb="1" cb="1"/><line nr="7" mi="4" ci="0" mb="0" cb="0"/><line nr="9" mi="0" ci="3" mb="0" cb="0"/><line nr="11" mi="0" ci="1" mb="0" cb="0"/><counter type="INSTRUCTION" missed="4" covered="9"/><counter type="BRANCH" missed="1" covered="1"/><counter type="LINE" missed="1" covered="4"/><counter type="COMPLEXITY" missed="1" covered="2"/><counter type="METHOD" missed="0" covered="2"/><counter type="CLASS" missed="0" covered="1"/></sourcefile><counter type="INSTRUCTION" missed="4" covered="9"/><counter type="BRANCH" missed="1" covered="1"/><counter type="LINE" missed="1" covered="4"/><counter type="COMPLEXITY" missed="1" covered="2"/><counter type="METHOD" missed="0" covered="2"/><counter type="CLASS" missed="0" covered="1"/></package><counter type="INSTRUCTION" missed="4" covered="9"/><counter type="BRANCH" missed="1" covered="1"/><counter type="LINE" missed="1" covered="4"/><counter type="COMPLEXITY" missed="1" covered="2"/><counter type="METHOD" missed="0" covered="2"/><counter type="CLASS" missed="0" covered="1"/></report>