codacy-maven-plugin Maven Plugin

Maven goal to upload coverage reports to codacy.com

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

com.gavinmogan
ArtifactId

ArtifactId

codacy-maven-plugin
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

codacy-maven-plugin Maven Plugin
Maven goal to upload coverage reports to codacy.com
Project URL

Project URL

https://github.com/halkeye/codacy-maven-plugin
Source Code Management

Source Code Management

https://github.com/halkeye/codacy-maven-plugin

Download codacy-maven-plugin

How to add to project

<plugin>
    <groupId>com.gavinmogan</groupId>
    <artifactId>codacy-maven-plugin</artifactId>
    <version>1.2.0</version>
</plugin>

Dependencies

compile (8)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.3.9
org.codehaus.plexus : plexus-utils jar 3.2.0
org.apache.maven : maven-core jar 3.3.9
org.apache.maven : maven-compat jar 3.3.9
commons-io : commons-io jar 2.5
org.apache.httpcomponents : httpclient jar 4.5.8
com.codacy : coverage-parser_2.11 jar 2.0.14
com.codacy : codacy-coverage-reporter jar 6.0.0

provided (2)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.5
org.apache.maven : maven-artifact jar 3.3.9

test (3)

Group / Artifact Type Version
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 3.3.0
junit : junit jar 4.12
org.mock-server : mockserver-netty jar 5.5.1

Project Modules

There are no modules declared in this project.

Maven Central

codacy-maven-plugin

Create and upload coverage report to https://codacy.com

Commandline Usage

mvn com.gavinmogan:codacy-maven-plugin:coverage -DcoverageReportFile=target/site/jacoco/jacoco.xml -DprojectToken=blah -DapiToken=blah

where:

  • coverageReportFile is either a Jacoco or Cobertura file
  • projectToken is your project token
  • apiToken is your api token

Enterprise

To send coverage in the enterprise version you should:

export CODACY_API_BASE_URL=<Codacy_instance_URL>:16006

Self Signed

In case your on-prem codacy server has a self-signed certificate, use -Dcodacy.trustSelfSignedCerts in the command line, or configure the plugin in the pom.xml using:

<configuration>
  <trustSelfSignedCerts>true</trustSelfSignedCerts>
</configuration>

POM Usage

Travis CI Example

<profiles>
      <profile>
          <id>codecoverage</id>
          <activation>
              <property><name>env.TRAVIS</name></property>
          </activation>
          <build>
              <plugins>
                  <plugin>
                      <groupId>com.gavinmogan</groupId>
                      <artifactId>codacy-maven-plugin</artifactId>
                      <version>1.2.0</version>
                      <configuration>
                          <apiToken>${env.CODACY_API_TOKEN}</apiToken>
                          <projectToken>${env.CODACY_PROJECT_TOKEN}</projectToken>
                          <coverageReportFile>${project.reporting.outputDirectory}/jacoco.xml</coverageReportFile>
                          <commit>${env.TRAVIS_COMMIT}</commit>
                          <codacyApiBaseUrl>https://api.codacy.com</codacyApiBaseUrl>
                          <failOnMissingReportFile>false</failOnMissingReportFile>
                      </configuration>
                      <executions>
                          <execution>
                              <id>post-test</id>
                              <phase>post-integration-test</phase>
                              <goals>
                                  <goal>coverage</goal>
                              </goals>
                          </execution>
                      </executions>
                  </plugin>
              </plugins>
          </build>
      </profile>
  </profiles>

License

MIT

Contributing

I'm open to any and all forms of contribution. Documentation improvements, issues, pull requests, patches, test cases, etc.

Versions

Version
1.2.0
1.1.0
1.0.3
1.0.2
1.0.1
1.0.0