Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit a9d44c0

Browse files
Merge pull request #96 from Venafi/coverage
Added jacoco plugin to pom.xml
2 parents a857478 + 45b85ce commit a9d44c0

3 files changed

Lines changed: 41 additions & 36 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM maven:3.8.4-openjdk-11
2+
3+
ENV SONAR_SCANNER_VERSION="4.6.2.2472"
4+
5+
# Installing sonar-scanner tool
6+
WORKDIR /root
7+
RUN apt-get update
8+
RUN apt-get install -y wget unzip
9+
RUN wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.zip
10+
RUN unzip sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.zip
11+
RUN rm sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.zip
12+
RUN mv ./sonar-scanner-${SONAR_SCANNER_VERSION}-linux ./sonar-scanner
13+
ENV PATH="/root/sonar-scanner/bin:${PATH}"
14+
15+
# Copying plugin and installing dependencies
16+
COPY . /usr/src/vcert-java
17+
18+
WORKDIR /usr/src/vcert-java
19+
20+
CMD ["/bin/bash" ]

pom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
<tweetnacl-java.version>1.1.2</tweetnacl-java.version>
8080
<sonar.organization>venafi</sonar.organization>
8181
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
82+
<jacoco.version>0.8.7</jacoco.version>
8283
</properties>
8384

8485
<dependencies>
@@ -299,6 +300,26 @@
299300
<autoReleaseAfterClose>true</autoReleaseAfterClose>
300301
</configuration>
301302
</plugin>
303+
<!-- Code Coverage report generation -->
304+
<plugin>
305+
<groupId>org.jacoco</groupId>
306+
<artifactId>jacoco-maven-plugin</artifactId>
307+
<version>${jacoco.version}</version>
308+
<executions>
309+
<execution>
310+
<goals>
311+
<goal>prepare-agent</goal>
312+
</goals>
313+
</execution>
314+
<execution>
315+
<id>generate-code-coverage-report</id>
316+
<phase>test</phase>
317+
<goals>
318+
<goal>report</goal>
319+
</goals>
320+
</execution>
321+
</executions>
322+
</plugin>
302323
</plugins>
303324
</build>
304325
</project>

0 commit comments

Comments
 (0)