{"id":21409694,"url":"https://github.com/edgar-code-repository/code-coverage-with-jacoco","last_synced_at":"2025-07-12T23:34:28.938Z","repository":{"id":150026249,"uuid":"603611504","full_name":"edgar-code-repository/code-coverage-with-jacoco","owner":"edgar-code-repository","description":"Measuring code coverage with the Java Code Coverage Library (JaCoCo)","archived":false,"fork":false,"pushed_at":"2023-03-18T23:11:31.000Z","size":404,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T17:45:29.874Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edgar-code-repository.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-19T03:18:08.000Z","updated_at":"2023-02-19T03:18:48.000Z","dependencies_parsed_at":"2023-05-19T00:45:53.815Z","dependency_job_id":null,"html_url":"https://github.com/edgar-code-repository/code-coverage-with-jacoco","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/edgar-code-repository/code-coverage-with-jacoco","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgar-code-repository%2Fcode-coverage-with-jacoco","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgar-code-repository%2Fcode-coverage-with-jacoco/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgar-code-repository%2Fcode-coverage-with-jacoco/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgar-code-repository%2Fcode-coverage-with-jacoco/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edgar-code-repository","download_url":"https://codeload.github.com/edgar-code-repository/code-coverage-with-jacoco/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edgar-code-repository%2Fcode-coverage-with-jacoco/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265068592,"owners_count":23706488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T17:28:12.479Z","updated_at":"2025-07-12T23:34:28.923Z","avatar_url":"https://github.com/edgar-code-repository.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"CODE COVERAGE WITH JACOCO\n--------------------------------------------------------------------------\n\nMeasuring code coverage with the Java Code Coverage Library (JaCoCo).\n\n--------------------------------------------------------------------------\n\n**JaCoCo plugin added to pom.xml file:**\n\n```\n\n    \u003cplugin\u003e\n        \u003cgroupId\u003eorg.jacoco\u003c/groupId\u003e\n        \u003cartifactId\u003ejacoco-maven-plugin\u003c/artifactId\u003e\n        \u003cversion\u003e0.8.5\u003c/version\u003e\n        \u003cconfiguration\u003e\n            \u003cexcludes\u003e\n                \u003cexclude\u003ecom/example/demo/CodeCoverageWith*\u003c/exclude\u003e\n                \u003cexclude\u003ecom/example/demo/configuration/*\u003c/exclude\u003e\n                \u003cexclude\u003ecom/example/demo/dto/*\u003c/exclude\u003e\n                \u003cexclude\u003ecom/example/demo/dto/response/*\u003c/exclude\u003e\n                \u003cexclude\u003ecom/example/demo/model/*\u003c/exclude\u003e\n                \u003cexclude\u003ecom/example/demo/repository/*\u003c/exclude\u003e\n            \u003c/excludes\u003e\n        \u003c/configuration\u003e\n        \u003cexecutions\u003e\n            \u003cexecution\u003e\n                \u003cgoals\u003e\n                    \u003cgoal\u003eprepare-agent\u003c/goal\u003e\n                \u003c/goals\u003e\n            \u003c/execution\u003e\n            \u003c!-- attached to Maven test phase --\u003e\n            \u003cexecution\u003e\n                \u003cid\u003ereport\u003c/id\u003e\n                \u003cphase\u003etest\u003c/phase\u003e\n                \u003cgoals\u003e\n                    \u003cgoal\u003ereport\u003c/goal\u003e\n                \u003c/goals\u003e\n                \u003cconfiguration\u003e\n                    \u003coutputDirectory\u003etarget/jacoco-report\u003c/outputDirectory\u003e\n                \u003c/configuration\u003e\n            \u003c/execution\u003e\n        \u003c/executions\u003e\n    \u003c/plugin\u003e\n\n```\n\n**Some packages were exluded from JaCoCo:**\n\n```\n    \u003cexcludes\u003e\n        \u003cexclude\u003ecom/example/demo/CodeCoverageWith*\u003c/exclude\u003e\n        \u003cexclude\u003ecom/example/demo/configuration/*\u003c/exclude\u003e\n        \u003cexclude\u003ecom/example/demo/dto/*\u003c/exclude\u003e\n        \u003cexclude\u003ecom/example/demo/dto/response/*\u003c/exclude\u003e\n        \u003cexclude\u003ecom/example/demo/model/*\u003c/exclude\u003e\n        \u003cexclude\u003ecom/example/demo/repository/*\u003c/exclude\u003e\n    \u003c/excludes\u003e\n```\n\n**Location where the report will be generated:**\n\n```\n    \u003cconfiguration\u003e\n        \u003coutputDirectory\u003etarget/jacoco-report\u003c/outputDirectory\u003e\n    \u003c/configuration\u003e\n```\n\n--------------------------------------------------------------------------\n\n**After JaCoco plugin is added, the test maven phase is executed:**\n\n![TestPhase](./screenshots/maven_test_phase.png)\n\n**A report is generated in the directory target/jacoco-report:**\n\n![](./screenshots/jacoco_report_directory.png)\n\n**Right now, there are no tests available and the JaCoCo report says there is a code coverage of 7% \nfor missed instructions and 0% for missed branches:**\n\n![Report1](./screenshots/jacoco_report_1.png)\n\n**A few unit tests were added and now the code coverage has reached 97% for missed instructions \nand 83% for missed branches:**\n\n![Report2](./screenshots/jacoco_report_2.png)\n\n\n--------------------------------------------------------------------------","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgar-code-repository%2Fcode-coverage-with-jacoco","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedgar-code-repository%2Fcode-coverage-with-jacoco","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedgar-code-repository%2Fcode-coverage-with-jacoco/lists"}