|
1 |
| -[Codecov][0] Java Maven Example |
2 |
| -=============================== |
| 1 | +# [Codecov][1] Java Maven Example |
| 2 | +## Guide |
| 3 | +### Travis Setup |
3 | 4 |
|
4 |
| -1. Add `cobertura-maven-plugin` plugin to your pom.xml file, [see here](https://github.com/codecov/example-java-maven/blob/master/pom.xml#L47-L58) |
5 |
| -1. Call `mvn cobertura:cobertura` during your CI tests, [see here](https://github.com/codecov/example-java-maven/blob/master/.travis.yml#L4) |
6 |
| -1. Call `bash <(curl -s https://codecov.io/bash)` at the end of your CI build, [see here](https://github.com/codecov/example-java-maven/blob/master/.travis.yml#L7) |
7 |
| - - Using Travis CI, CircleCI or AppVeyor **AND** the repository is public? **You're done!** No token needed. |
8 |
| - - Otherwise, please add your [repository token token][5]. |
| 5 | +Add to your `.travis.yml` file. |
| 6 | +```yml |
| 7 | +language: java |
9 | 8 |
|
10 |
| -> Other Examples |
11 |
| -> - [Java JaCoCo Example][1] |
12 |
| -> - [Android Example][3] |
13 |
| -> - [Gradle Example][2] |
| 9 | +script: "mvn cobertura:cobertura" |
14 | 10 |
|
| 11 | +after_success: |
| 12 | + - bash <(curl -s https://codecov.io/bash) |
| 13 | +``` |
| 14 | +### Produce Coverage Reports |
| 15 | +#### Add Cobertura plugin |
| 16 | +```xml |
| 17 | +<plugin> |
| 18 | + <groupId>org.codehaus.mojo</groupId> |
| 19 | + <artifactId>cobertura-maven-plugin</artifactId> |
| 20 | + <version>2.7</version> |
| 21 | + <configuration> |
| 22 | + <formats> |
| 23 | + <format>html</format> |
| 24 | + <format>xml</format> |
| 25 | + </formats> |
| 26 | + <check /> |
| 27 | + </configuration> |
| 28 | +</plugin> |
| 29 | +``` |
| 30 | +Call `mvn cobertura:cobertura` during your CI tests, [see here](https://github.com/codecov/example-java-maven/blob/master/.travis.yml#L4) |
15 | 31 |
|
| 32 | +## Caveats |
| 33 | +### Private Repos |
| 34 | +Add to your `.travis.yml` file. |
| 35 | +```yml |
| 36 | +after_success: |
| 37 | + - bash <(curl -s https://codecov.io/bash) -t uuid-repo-token |
| 38 | +``` |
| 39 | +## Support |
| 40 | +### FAQ |
| 41 | +- Q: Is there a Gradle example?<br/>A: **Yes**, enter [codecov/example-gradle][2] |
| 42 | +- Q: Is there a Andorid example?<br/>A: **Yes**, enter [codecov/example-android][3] |
| 43 | +- Q: Is there a Jacoc example?<br/>A: **Yes**, enter [codecov/example-java][4] |
16 | 44 |
|
17 |
| -[0]: https://codecov.io/ |
18 |
| -[1]: https://github.com/codecov/example-java |
| 45 | +### Contact |
| 46 | +- Intercom (in-app messanger) |
| 47 | + |
| 48 | +- Slack: [slack.codecov.io](https://slack.codecov.io) |
| 49 | +- [gh/codecov/support](https://github.com/codecov/support) |
| 50 | +
|
| 51 | +1. More documentation at https://docs.codecov.io |
| 52 | +2. Configure codecov through the `codecov.yml` https://docs.codecov.io/docs/codecov-yaml |
| 53 | + |
| 54 | +[1]: https://codecov.io/ |
19 | 55 | [2]: https://github.com/codecov/example-gradle
|
20 | 56 | [3]: https://github.com/codecov/example-android
|
21 |
| -[5]: http://docs.codecov.io/docs/about-the-codecov-bash-uploader#section-upload-token |
| 57 | +[4]: https://github.com/codecov/example-java |
0 commit comments