Skip to content

Commit

Permalink
Merge pull request #73 from ssylver93/feature/WFPREV-34_3
Browse files Browse the repository at this point in the history
Test aggregate sonar run
  • Loading branch information
ssylver93 authored Sep 25, 2024
2 parents 7ae71d1 + 39e93b4 commit f3f8be1
Show file tree
Hide file tree
Showing 12 changed files with 270 additions and 205 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/sonarscan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'adopt'
- name: SonarCloud Scan
run: |
export MAVEN_OPTS="-Xmx10000m"
export NODE_OPTIONS="--max-old-space-size=4096"
mvn clean --settings server/wfprev-api/mvn_settings/settings.xml -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=bcgov_nr-bcws-wfprev -Drepo.login=${{ secrets.IDIR_AS_EMAIL }} -Drepo.password=${{ secrets.IDIR_PASSWORD }}
mvn clean --settings server/wfprev-api/mvn_settings/settings.xml -B org.jacoco:jacoco-maven-plugin:prepare-agent verify org.jacoco:jacoco-maven-plugin:report org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=bcgov_nr-bcws-wfprev -Drepo.login=${{ secrets.IDIR_AS_EMAIL }} -Drepo.password=${{ secrets.IDIR_PASSWORD }} -DWFPREV_CLIENT_ID=${{ secrets.WFPREV_CLIENT_ID }} -DWFPREV_CLIENT_SECRET=${{ secrets.WFPREV_CLIENT_SECRET }} -DWEBADE_OAUTH2_CHECK_TOKEN_URL=${{ secrets.WEBADE_OAUTH2_CHECK_TOKEN_URL }} -DWEBADE_OAUTH2_CHECK_AUTHORIZE_URL=${{ secrets.WEBADE_OAUTH2_CHECK_AUTHORIZE_URL }} -DWFPREV_DATASOURCE_URL=${{ secrets.WFPREV_DATASOURCE_URL }} -DWFPREV_DATASOURCE_USERNAME=${{ secrets.WFPREV_DATASOURCE_USERNAME }} -DWFPREV_DATASOURCE_PASSWORD=${{ secrets.WFPREV_DATASOURCE_PASSWORD }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78 changes: 57 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,68 @@

<modules>
<module>server/wfprev-api</module>
<module>report-aggregate-module</module>
<module>wfprev-report-aggregate-module</module>
</modules>

<properties>
<sonar.coverage.jacoco.xmlReportPaths>
${project.basedir}/report-aggregate/target/site/
jacoco-aggregate/jacoco.xml
</sonar.coverage.jacoco.xmlReportPaths>
<java.version>17</java.version>
<!-- plugins -->
<sonar.version>4.0.0.4121</sonar.version>
<jacoco.version>0.8.11</jacoco.version>
<surefire.version>3.5.0</surefire.version>
<aggregate.report.dir>librairy-test/target/site/jacoco-aggregate/jacoco.xml</aggregate.report.dir>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.9</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonar.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>

</project>
<profiles>
<profile>
<id>coverage</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
42 changes: 0 additions & 42 deletions report-aggregate-module/pom.xml

This file was deleted.

1 change: 1 addition & 0 deletions server/wfprev-api/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ target/
!**/src/main/**/target/
!**/src/test/**/target/
.mvn/
.metadata/

### STS ###
.apt_generated
Expand Down
2 changes: 1 addition & 1 deletion server/wfprev-api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ FROM tomcat:10.1-jdk17-corretto
RUN rm -rf /usr/local/tomcat/webapps/*

# Copy the WAR file to the Tomcat webapps directory
COPY target/wfprev-1.0.0-SNAPSHOT.war /usr/local/tomcat/webapps/ROOT.war
COPY target/wfprev-api-1.0.0-SNAPSHOT.war /usr/local/tomcat/webapps/ROOT.war

ENV TOMCAT_HOME=/usr/local/tomcat \
CATALINA_HOME=/usr/local/tomcat \
Expand Down
163 changes: 88 additions & 75 deletions server/wfprev-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<groupId>ca.bc.gov.nrs</groupId>
<groupId>ca.bc.gov.nrs.wfprev</groupId>
<artifactId>wfprev-api</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>
Expand Down Expand Up @@ -131,62 +131,62 @@
<dependency>
<groupId>ca.bc.gov.nrs.wfone.common</groupId>
<artifactId>wfone-common-model</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ca.bc.gov.nrs.wfone.common</groupId>
<artifactId>wfone-common-rest-common</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ca.bc.gov.nrs.wfone.common</groupId>
<artifactId>wfone-common-rest-client</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ca.bc.gov.nrs.wfone.common</groupId>
<artifactId>wfone-common-persistence</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ca.bc.gov.nrs.wfone.common</groupId>
<artifactId>wfone-common-utils</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ca.bc.gov.nrs.wfone.common</groupId>
<artifactId>wfone-common-service-api</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ca.bc.gov.nrs.wfone.common</groupId>
<artifactId>wfone-common-code-persistence</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ca.bc.gov.nrs.wfone.common</groupId>
<artifactId>wfone-common-webade</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ca.bc.gov.nrs.wfone.common</groupId>
<artifactId>wfone-common-webade-oauth2-test</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ca.bc.gov.nrs.wfone.common</groupId>
<artifactId>wfone-common-rest-endpoints</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ca.bc.gov.nrs.wfone.common</groupId>
<artifactId>wfone-common-code-endpoints</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ca.bc.gov.nrs.wfone.common</groupId>
<artifactId>wfone-common-checkhealth</artifactId>
<version>1.4.1-SNAPSHOT</version>
<version>1.5.0-SNAPSHOT</version>
</dependency>

<dependency>
Expand All @@ -205,68 +205,81 @@
<version>4.0.0.4121</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.hibernate.orm.tooling</groupId>
<artifactId>hibernate-enhance-maven-plugin</artifactId>
<version>${hibernate.version}</version>
<executions>
<execution>
<id>enhance</id>
<goals>
<goal>enhance</goal>
</goals>
<configuration>
<enableLazyInitialization>true</enableLazyInitialization>
<enableDirtyTracking>true</enableDirtyTracking>
<enableAssociationManagement>true</enableAssociationManagement>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>generate-docs</id>
<phase>prepare-package</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
<configuration>
<backend>html</backend>
<doctype>book</doctype>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.springframework.restdocs</groupId>
<artifactId>spring-restdocs-asciidoctor</artifactId>
<version>${spring-restdocs.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.hibernate.orm.tooling</groupId>
<artifactId>hibernate-enhance-maven-plugin</artifactId>
<version>${hibernate.version}</version>
<executions>
<execution>
<id>enhance</id>
<goals>
<goal>enhance</goal>
</goals>
<configuration>
<enableLazyInitialization>true</enableLazyInitialization>
<enableDirtyTracking>true</enableDirtyTracking>
<enableAssociationManagement>true</enableAssociationManagement>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>generate-docs</id>
<phase>prepare-package</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
<configuration>
<backend>html</backend>
<doctype>book</doctype>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.springframework.restdocs</groupId>
<artifactId>spring-restdocs-asciidoctor</artifactId>
<version>${spring-restdocs.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Loading

0 comments on commit f3f8be1

Please sign in to comment.