https://github.com/feltex/sonarqube
https://github.com/feltex/sonarqube
docker docker-compose jacoco java java11 project sonarqube test
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/feltex/sonarqube
- Owner: feltex
- Created: 2023-02-15T23:15:10.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-20T11:33:39.000Z (almost 3 years ago)
- Last Synced: 2025-03-12T14:49:35.899Z (10 months ago)
- Topics: docker, docker-compose, jacoco, java, java11, project, sonarqube, test
- Homepage: http://www.youtube.com/feltexbr?sub_confirmation=1
- Size: 39.1 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SonarQube
Como configurar o SonarQube no seu projeto Java.

## Vídeo no youtube
[sonar](https://www.youtube.com/watch?v=dnvHgocLupM)
## Projeto Base
Server status
[https://github.com/feltex/server-status](https://github.com/feltex/server-status)
---
- Como instalar o SonarQube: https://docs.sonarqube.org/9.8/setup-and-upgrade/install-the-server/
- Acessar o SonarQube
- Gerar o Token no SonarQube
- Gerar o relatório do Sonar
- Adicionar dependência Jacoco
- Configurar o plugin Jacoco
- Gerar o relatório Jacoco
## Configuração do projeto
```
11
0.8.6
jacoco
reuseReports
${project.basedir}/../target/jacoco.exec
java
org.jacoco
jacoco-maven-plugin
${jacoco.version}
....
org.jacoco
jacoco-maven-plugin
${jacoco.version}
jacoco-initialize
prepare-agent
jacoco-site
package
report
jacoco-check
check
PACKAGE
LINE
COVEREDRATIO
0.20
```
### Comandos do Maven
```shell
mvn clean install
```
```shell
mvn sonar:sonar -Dsonar.host.url=http://localhost:9000 -Dsonar.login=sqa_8d7e8e6913f1c2a7e103b14f86910e33cb9afee8
```
### SonarQube no Docker
Iniciar o SonarQube
```shell
docker-compose -f docker/docker-compose.yaml up
```
[Acesse](http://localhost:9000)
Parar o SonarQube
```shell
docker-compose -f docker/docker-compose.yaml down
```
### O que pode dar errado
#### Warning
```
[WARNING] The artifact org.codehaus.mojo:sonar-maven-plugin:jar:3.9.1.2184 has been relocated to org.sonarsource.scanner.maven:sonar-maven-plugin:jar:3.9.1.2184: SonarQube plugin was moved to SonarSource organisation
```
Atualize a dependência
Caso você não consiga iniciar o SonarQube por problema de memória virtual
```
Feb 15 14:53:46 scratchpad elasticsearch: [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
https://stackoverflow.com/questions/51445846/elasticsearch-max-virtual-memory-areas-vm-max-map-count-65530-is-too-low-inc
```