From 601e2453df20a661762f92485073f321e4cfc4f6 Mon Sep 17 00:00:00 2001 From: cjp4 Date: Sat, 24 Dec 2022 10:47:55 -0500 Subject: [PATCH 1/2] add sonar and checkstyle --- README.md | 33 ++++++++++++++++++++++++++++++ checkstyle.xml | 54 -------------------------------------------------- pom.xml | 29 +++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 54 deletions(-) diff --git a/README.md b/README.md index 1374f386..3faa198b 100644 --- a/README.md +++ b/README.md @@ -47,3 +47,36 @@ team help ... # run jar java -jar target/github-stats-*.jar ``` + +## CheckStyle + +```sh +# compile the code +mvn clean site + +# file configuration +checkStyle.xml + +# file route +\target\site\checkstyle.html +``` + +## Sonar + +```sh + +# execute docker +docker run -d --name sonarqube -p 9000:9000 sonarqube + +# first time +- crear un usuario +- registrar el proyecto en sonar +- seleccionar maven +- copiar codigo de git con credenciales + +# example +mvn clean verify sonar:sonar \ + -Dsonar.projectKey=github-stats \ + -Dsonar.host.url=http://localhost:9000 \ + -Dsonar.login=sqp_3767710a555637629d9c6281fbf1bdf5fe87a942 +``` \ No newline at end of file diff --git a/checkstyle.xml b/checkstyle.xml index cc3ae1b9..9cc05ca1 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -119,11 +119,6 @@ - - - - - - - - - - @@ -217,55 +207,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pom.xml b/pom.xml index ef97f507..ecd1e49a 100644 --- a/pom.xml +++ b/pom.xml @@ -99,6 +99,16 @@ + + org.apache.maven.plugins + maven-site-plugin + 3.7 + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 3.0.0 + org.springframework.boot spring-boot-maven-plugin @@ -120,4 +130,23 @@ + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.2.0 + + checkstyle.xml + + + + + checkstyle + + + + + + From ecb519a6e306fac69b43a97728eb457e2d048c49 Mon Sep 17 00:00:00 2001 From: Miquel de Domingo Date: Sun, 25 Dec 2022 08:23:01 +0100 Subject: [PATCH 2/2] docs: update readme --- README.md | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 3faa198b..37cbdf43 100644 --- a/README.md +++ b/README.md @@ -48,32 +48,26 @@ team help ... java -jar target/github-stats-*.jar ``` -## CheckStyle +### CheckStyle ```sh # compile the code mvn clean site +``` -# file configuration -checkStyle.xml +### Sonar -# file route -\target\site\checkstyle.html -``` +Before running sonar: -## Sonar +- Create a user +- Register the project in sonar +- Choose maven +- Copy git code with credentials ```sh - -# execute docker +# run in docker docker run -d --name sonarqube -p 9000:9000 sonarqube -# first time -- crear un usuario -- registrar el proyecto en sonar -- seleccionar maven -- copiar codigo de git con credenciales - # example mvn clean verify sonar:sonar \ -Dsonar.projectKey=github-stats \