Skip to content

adityaparikh91087/multi-module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi-Module Spring Boot Project with SonarCloud and JaCoCo

This is a multi-module Spring Boot project with SonarCloud and JaCoCo integration for code quality analysis and code coverage reporting.

Project Structure

The project consists of two modules:

  • application: The main Spring Boot application
  • library: A library module with utility functions

SonarCloud Integration

This project is integrated with SonarCloud for continuous code quality analysis. SonarCloud analyzes the code for bugs, vulnerabilities, code smells, and test coverage.

Setup SonarCloud

  1. Create a SonarCloud account at https://sonarcloud.io/
  2. Create a new project in SonarCloud
  3. Update the following properties in the parent pom.xml file:
    <sonar.projectKey>your-project-key</sonar.projectKey>
    <sonar.organization>your-organization</sonar.organization>
  4. Add a SONAR_TOKEN secret to your GitHub repository:
    • Go to your GitHub repository
    • Go to Settings > Secrets and variables > Actions
    • Create a new repository secret named SONAR_TOKEN with the value of your SonarCloud token

Running SonarCloud Analysis

The SonarCloud analysis is automatically triggered by the GitHub Actions workflow on every push to the main branch and on pull requests.

You can also run the analysis locally with:

mvn clean verify sonar:sonar

JaCoCo Integration

This project uses JaCoCo for code coverage analysis. JaCoCo generates code coverage reports that are used by SonarCloud to display code coverage metrics.

Running JaCoCo

JaCoCo is automatically run as part of the Maven build process. To generate code coverage reports, run:

mvn clean verify

The JaCoCo reports will be generated in the target/site/jacoco directory of each module and an aggregated report will be generated in the target/site/jacoco-aggregate directory of the parent project.

GitHub Actions Workflow

The project includes a GitHub Actions workflow that builds the project, runs tests, generates code coverage reports, and runs SonarCloud analysis on every push to the main branch and on pull requests.

The workflow is defined in the .github/workflows/sonarcloud.yml file.

Running the Application

To run the application, use:

mvn spring-boot:run -pl application

Running Tests

To run the tests, use:

mvn test

Building the Project

To build the project, use:

mvn clean install
```# multi-module

About

Junie generated spring-boot multi-module maven project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages