diff --git a/.github/workflows/enforce-license-compliance.yml b/.github/workflows/enforce-license-compliance.yml new file mode 100644 index 0000000..86be741 --- /dev/null +++ b/.github/workflows/enforce-license-compliance.yml @@ -0,0 +1,14 @@ +name: Enforce License Compliance + +on: + pull_request: + branches: [main, master] + +jobs: + enforce-license-compliance: + runs-on: ubuntu-latest + steps: + - name: 'Enforce License Compliance' + uses: getsentry/action-enforce-license-compliance@57ba820387a1a9315a46115ee276b2968da51f3d # main + with: + fossa_api_key: ${{ secrets.FOSSA_API_KEY }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7d0efc5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: java -sudo: false # faster builds - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..c341b2a --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Codecov + +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. diff --git a/README.md b/README.md index 3c55dde..ad1db91 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,17 @@ +# [Codecov](https://codecov.io) Java +[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fexample-java.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fexample-java?ref=badge_shield) +This repository points to other example repositories on how Codecov can be integrated with a simple Java project. +- [example-java-gradle](https://github.com/codecov/example-java-gradle) +- [example-java-maven](https://github.com/codecov/example-java-maven) +- [example-java-android](https://github.com/codecov/example-java-android) -# [Codecov][0] Java Example +For more information, please see the links below. -## Guide - -### Travis Setup - -Add the following to your `.travis.yml`: -```yml -language: java -after_success: - - bash <(curl -s https://codecov.io/bash) -``` - -### Produce Coverage Reports -1. Add JaCoCo Plugin to your pom.xml file, [see here](https://github.com/codecov/example-java/blob/master/pom.xml#L38-L56) - -## Caveats - -#### Private Repo -You will need to add the following your `.travis.yml`: -```yml -env: - global: - - CODECOV_TOKEN=:uuid-repo-token -``` - -#### JaCoCo Reports - -- Make sure you are on the most up-to-date JaCoCo version. There are issues with previous versions of JaCoCo. -- JaCoCo reports can expire - Codecov will reject reports that are older than 12 hours. The logs contain details if a report expired. - -## Support - -### FAQ -- Q: How do I enable multi-module projects?
A: In your `pom.xml` file please append a list of modules in your projects: -```xml - - - module_a/ - module_b/ - - -``` -- Q: Seeing `Skipping JaCoCo execution due to missing execution data file`?
A: Please see [http://stackoverflow.com/questions/18107375/...](http://stackoverflow.com/questions/18107375/getting-skipping-jacoco-execution-due-to-missing-execution-data-file-upon-exec). -- We should talk about using other CIs here. -- Q: Does Codecov accept `jacoco.exec` reports?
A: **No**, these files are not supported. Please produce a `xml` file as detailed in the pom.xml file at [codecov/example-java][1]. -- Q: Is there a Gradle example?
A: **Yes**, enter [codecov/example-gradle][2] -- Q: Is there a Android example?
A: **Yes**, enter [codecov/example-android][3] -- Q: Is there a Maven example?
A: **Yes**, enter [codecov/example-maven][4] - -1. More documentation at https://docs.codecov.io -2. Configure codecov through the `codecov.yml` https://docs.codecov.io/docs/codecov-yaml -3. View source and learn more about [Codecov Global Uploader](https://github.com/codecov/codecov-bash) - -We are happy to help if you have any questions. Please contact email our Support at [support@codecov.io](mailto:support@codecov.io) - -[0]: https://codecov.io/ -[1]: https://github.com/codecov/example-java -[2]: https://github.com/codecov/example-gradle -[3]: https://github.com/codecov/example-android -[4]: https://github.com/codecov/example-java-maven -[5]: https://docs.codecov.io/docs/about-the-codecov-bash-uploader#section-upload-token +## Links +- [Quick Start](https://docs.codecov.com/docs/quick-start) +- [GitHub Tutorial](https://docs.codecov.com/docs/github-tutorial) +- [Community Boards](https://community.codecov.io) +- [Support](https://codecov.io/support) +- [Documentation](https://docs.codecov.io) diff --git a/pom.xml b/pom.xml deleted file mode 100644 index e4411a2..0000000 --- a/pom.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - 4.0.0 - - org.jacoco - org.jacoco.examples.maven.java - 1.0-SNAPSHOT - jar - - JaCoCo Maven plug-in example for Java project - http://www.eclemma.org/jacoco - - - - junit - junit - 4.10 - test - - - - - src/main/java - - - org.jacoco - jacoco-maven-plugin - 0.8.2 - - - - prepare-agent - - - - report - test - - report - - - - - - - - diff --git a/src/main/java/org/jacoco/examples/maven/java/HelloWorld.java b/src/main/java/org/jacoco/examples/maven/java/HelloWorld.java deleted file mode 100644 index a36abe7..0000000 --- a/src/main/java/org/jacoco/examples/maven/java/HelloWorld.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.jacoco.examples.maven.java; - -public class HelloWorld { - - public String getMessage(boolean bigger) { - if (bigger) { - return "Hello Universe!"; - } else { - return "Hello World!"; - } - } - -} diff --git a/src/test/java/org/jacoco/examples/maven/java/HelloWorldTest.java b/src/test/java/org/jacoco/examples/maven/java/HelloWorldTest.java deleted file mode 100644 index 2d17e16..0000000 --- a/src/test/java/org/jacoco/examples/maven/java/HelloWorldTest.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.jacoco.examples.maven.java; - -import static org.junit.Assert.*; - -import org.junit.Before; -import org.junit.Test; - -public class HelloWorldTest { - - private HelloWorld subject; - - @Before - public void setup() { - subject = new HelloWorld(); - } - - @Test - public void testGetMessage() { - assertEquals("Hello World!", subject.getMessage(false)); - } - -}