Closed HandOfGod94 closed 6 years ago
@HandOfGod94 I can't reproduce the bug with the current version (0771c12c15ee09653c521451412328a8f003ca9d with Apache Maven 3.5.4).
From what I see from the code, it's correctly implemented.
By testing, it seems to work too.
This works:
mvn -Dbadge.badgeLabel=foo org.gahan:jacoco-badge-maven-plugin:1.0-SNAPSHOT:badge
This works also:
<plugin>
<groupId>org.gahan</groupId>
<artifactId>jacoco-badge-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<executions>
<execution>
<id>generate-badge</id>
<phase>post-site</phase>
<configuration>
<badgeLabel>foo</badgeLabel>
</configuration>
<goals>
<goal>badge</goal>
</goals>
</execution>
</executions>
</plugin>
Am I missing something here?
Hi @ccamel, Thanks for the detailed comment I was not getting time to verify it with different configurations (like you did), that's the reason I kept it as an issue. In my initial implementation, I had hard coded it and I don't want to miss out on my TODOs.
Sorry the name is confusing, it's more of a verification then bug.
It still requires a little bit of testing to cover the corner-cases such as invalid or html-like string as coverage key. I'm expecting it might break with those kind of characters as I'm not escaping the values, might not be that important as it's just local generation of badges but still would like to cover those areas.
If you get the chance to verify do update the issue, with the values which you have tried so I can close it.
I'll try to finish few more issues/features over this weekend
Meanwhile, if you find it useful, feel free to use it.
@HandOfGod94 Yes you're right. As the values are not escaped, the generated svg can be not well-formed.
For instance:
mvn -Dbadge.badgeLabel='<foo>' org.gahan:jacoco-badge-maven-plugin:1.0-SNAPSHOT:badge
Default key for coverage badge is
coverage
. A user can also provide its custom value in maven configuration asbadgeLabel
. The value should be picked up for badge generation.Expected:
<badgeLabel>foo</badgeLabel>
should generate label withfoo
as its value. Actual: Currently, its only generating label withcoverage
as the key