-
Bug
-
Resolution: Fixed
-
Minor
-
None
I am writing unit tests for my Jenkins pipelines, involving some custom logic for retrieving/handling the coverage results. For this, I rely on the coverage-model module:
dependencies { // ... implementation 'edu.hm.hafner:coverage-model:0.46.0' // ... }
Using
import edu.hm.hafner.coverage.Coverage.CoverageBuilder
now to implement something similar to the original pipeline with
private Optional<Value> convertToCoverage(final Fraction fraction, final Metric metric) { return Optional.ofNullable( new CoverageBuilder().withMetric(metric) .withCovered(fraction.getNumerator()) .withTotal(fraction.getDenominator()) .build() ) }
I am observing issues about edu.hm.hafner.util.Ensure not being available. The Gradle dependency tree does not report a suitable dependency as well.
Trying to find a standalone package for this turned out to not be easy: I could either use codingstyle-pom which does not seem to make much sense for a standalone use case or retrieve my own copy from either https://github.com/uhafner/codingstyle/blob/main/src/main/java/edu/hm/hafner/util/Ensure.java or https://github.com/uhafner/config/blob/master/src/main/java/edu/hm/hafner/util/Ensure.java, which does not feel correct either and introduces further dependencies which do not seem to be necessary.
At the moment, I am using a local copy of Ensure.java without external dependencies, but this does not feel correct. In my opinion, edu.hm.hafner.util should be distributed as a regular package for further re-use to allow clean library usage.
[JENKINS-73663] Dependencies are missing in released artifact
Description |
Original:
I am writing unit tests for my Jenkins pipelines, involving some custom logic for retrieving/handling the coverage results. For this, I rely on the _coverage-model_ module:
{code:java} dependencies { // ... implementation 'edu.hm.hafner:coverage-model:0.46.0' // ... }{code} Using {code:java} import edu.hm.hafner.coverage.Coverage.CoverageBuilder{code} now to implement something similar to the original pipeline with {code:java} private Optional<Value> convertToCoverage(final Fraction fraction, final Metric metric) { return Optional.ofNullable( new CoverageBuilder().withMetric(metric) .withCovered(fraction.getNumerator()) .withTotal(fraction.getDenominator()) .build() ) }{code} I am observing issues about _edu.hm.hafner.util.Ensure_ not being available. The Gradle dependency tree does not report a suitable dependency as well. Trying to find a standalone package for this turned out to not be easy: I could either use _codingstyle-pom_ which does not seem to make much sense for a standalone use case or retrieve my own copy from either [https://github.com/uhafner/codingstyle/blob/main/src/main/java/edu/hm/hafner/util/Ensure.java] or [https://github.com/uhafner/config/blob/master/src/main/java/edu/hm/hafner/util/Ensure.java], which does not feel correct either and introduces further dependencies which do not seem to be necessary. At the moment, I am using a local copy of _Ensure.java_ without external dependencies, but this does not feel correct. In my opinion, _edu.hm.hafner.util_ should be distributed as a regular package for further re-use to allow clean library usage. |
New:
I am writing unit tests for my Jenkins pipelines, involving some custom logic for retrieving/handling the coverage results. For this, I rely on the _coverage-model_ module:
{code:java} dependencies { // ... implementation 'edu.hm.hafner:coverage-model:0.46.0' // ... }{code} Using {code:java} import edu.hm.hafner.coverage.Coverage.CoverageBuilder{code} now to implement something similar to the original pipeline with {code:java} private Optional<Value> convertToCoverage(final Fraction fraction, final Metric metric) { return Optional.ofNullable( new CoverageBuilder().withMetric(metric) .withCovered(fraction.getNumerator()) .withTotal(fraction.getDenominator()) .build() ) }{code} I am observing issues about _edu.hm.hafner.util.Ensure_ not being available. The Gradle dependency tree does not report a suitable dependency as well. Trying to find a standalone package for this turned out to not be easy: I could either use _codingstyle-pom_ which does not seem to make much sense for a standalone use case or retrieve my own copy from either [https://github.com/uhafner/codingstyle/blob/main/src/main/java/edu/hm/hafner/util/Ensure.java] or [https://github.com/uhafner/config/blob/master/src/main/java/edu/hm/hafner/util/Ensure.java], which does not feel correct either and introduces further dependencies which do not seem to be necessary. At the moment, I am using a local copy of _Ensure.java_ without external dependencies, but this does not feel correct. In my opinion, _edu.hm.hafner.util_ should be distributed as a regular package for further re-use to allow clean library usage. |
Component/s | New: coverage-model [ 29124 ] | |
Component/s | Original: coverage-plugin [ 29223 ] |
Summary | Original: coverage-model: Provide clean implementation of edu.hm.hafner.util | New: Dependencies are missing in released artifact |
Issue Type | Original: New Feature [ 2 ] | New: Bug [ 1 ] |
Status | Original: Open [ 1 ] | New: In Progress [ 3 ] |
Remote Link | New: This issue links to "coverage-model PR #122 (Web Link)" [ 29980 ] |
Remote Link | New: This issue links to "analysis-model PR#1087 (Web Link)" [ 29981 ] |
Remote Link | Original: This issue links to "analysis-model PR#1087 (Web Link)" [ 29981 ] |
Remote Link | New: This issue links to "analysis-model PR #1087 (Web Link)" [ 29982 ] |
Released As | New: https://github.com/jenkinsci/coverage-model/releases/tag/v0.47.0 | |
Resolution | New: Fixed [ 1 ] | |
Status | Original: In Progress [ 3 ] | New: Resolved [ 5 ] |