Configures Maven by setting environment variables M2_HOME, MAVEN_HOME, and PATH.
Runs source to apply changes immediately.
Verifies that Maven is installed correctly.
2️⃣ Clone the Java Project from GitHub
Downloads the sonardemo repository, which contains a Java project.
Builds the Java project using Maven:
clean → Removes old build files.
install → Compiles and packages the project.
3️⃣ Generate a SonarQube Token
The instructions mention SonarQube, a tool for static code analysis.
The user is asked to:
Go to User > My Account > Security in SonarQube.
Generate a new token named "Github_Token".
Copy the generated token.
4️⃣ Run Code Quality Analysis with SonarQube
Runs SonarQube static analysis on the project.
The -Dsonar.token option provides authentication to SonarQube.
The analysis checks for bugs, code smells, security vulnerabilities, and maintainability issues.
💡 Summary
✅ Installs Java 17 and Maven
✅ Clones a Java project from GitHub
✅ Builds the project using Maven
✅ Generates a SonarQube token for authentication
✅ Runs a SonarQube analysis on the project
🔹 Why is this important?
This setup ensures proper software quality control by checking the Java project's build status and code quality before deploying it.
Would you like help automating this setup in a script? 🚀