From 614eec5c267d1e78ad107845c786f1b6eb70b862 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sun, 3 Nov 2019 16:18:50 -0800 Subject: [PATCH] Added SonarCloud --- .gitignore | 1 + .travis.yml | 23 +++ pom.xml | 473 +++++++++++++++++++++++++++++----------------------- 3 files changed, 288 insertions(+), 209 deletions(-) create mode 100644 .travis.yml diff --git a/.gitignore b/.gitignore index a581609..231c26b 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ hs_err_pid* /.DS_Store /.classpath /.project +/.settings/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..496b0db --- /dev/null +++ b/.travis.yml @@ -0,0 +1,23 @@ +language: java +sudo: false +addons: + sonarcloud: + organization: "bentobox-world" + token: + secure: $SONAR_TOKEN +jdk: + - openjdk8 + - openjdk11 + +matrix: + allow_failures: + - jdk: openjdk11 + +script: + # the following command line builds the project, runs the tests with coverage and then execute the SonarCloud analysis + - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar -Dsonar.projectKey=BentoBoxWorld_CaveBlock + +cache: + directories: + - '$HOME/.m2/repository' + - '$HOME/.sonar/cache' diff --git a/pom.xml b/pom.xml index ca26307..589f161 100644 --- a/pom.xml +++ b/pom.xml @@ -1,224 +1,279 @@ - 4.0.0 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - world.bentobox - caveblock - ${revision} + world.bentobox + caveblock + ${revision} - CaveBlock - CaveBlock is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like SkyBlock or AcidIsland. - https://github.com/BentoBoxWorld/CaveBlock - 2019 + CaveBlock + CaveBlock is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like SkyBlock or AcidIsland. + https://github.com/BentoBoxWorld/CaveBlock + 2019 - - scm:git:https://github.com/BentoBoxWorld/CaveBlock.git - scm:git:git@github.com:BentoBoxWorld/CaveBlock.git - https://github.com/BentoBoxWorld/CaveBlock - + + scm:git:https://github.com/BentoBoxWorld/CaveBlock.git + scm:git:git@github.com:BentoBoxWorld/CaveBlock.git + https://github.com/BentoBoxWorld/CaveBlock + - - jenkins - http://ci.codemc.org/job/BentoBoxWorld/job/CaveBlock - + + jenkins + http://ci.codemc.org/job/BentoBoxWorld/job/CaveBlock + - - GitHub - https://github.com/BentoBoxWorld/CaveBlock/issues - + + GitHub + https://github.com/BentoBoxWorld/CaveBlock/issues + - - - codemc-snapshots - https://repo.codemc.org/repository/maven-snapshots - - - codemc-releases - https://repo.codemc.org/repository/maven-releases - - + + + codemc-snapshots + https://repo.codemc.org/repository/maven-snapshots + + + codemc-releases + https://repo.codemc.org/repository/maven-releases + + - - UTF-8 - UTF-8 - 1.8 - - 1.14.4-R0.1-SNAPSHOT - 1.8.0 - - ${build.version}-SNAPSHOT - - 1.8.0 - -LOCAL - + + UTF-8 + UTF-8 + 1.8 + + 1.14.4-R0.1-SNAPSHOT + 1.8.0 + + ${build.version}-SNAPSHOT + + 1.8.0 + -LOCAL + - - - - - ci - - - env.BUILD_NUMBER - - - - - -b${env.BUILD_NUMBER} - - - - - - - - master - - - env.GIT_BRANCH - origin/master - - - - - ${build.version} - - - - - + + + + + ci + + + env.BUILD_NUMBER + + + + + -b${env.BUILD_NUMBER} + + + + + + + + master + + + env.GIT_BRANCH + origin/master + + + + + ${build.version} + + + + + + sonar + + https://sonarcloud.io + bentobox-world + + + + + org.sonarsource.scanner.maven + sonar-maven-plugin + 3.6.0.1398 + + + verify + + sonar + + + + + + + + - - - spigot-repo - https://hub.spigotmc.org/nexus/content/repositories/snapshots - - - codemc-repo - https://repo.codemc.org/repository/maven-public - - + + + spigot-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots + + + codemc-repo + https://repo.codemc.org/repository/maven-public + + - - - org.spigotmc - spigot-api - ${spigot.version} - provided - - - world.bentobox - bentobox - ${bentobox.version} - provided - - + + + org.spigotmc + spigot-api + ${spigot.version} + provided + + + world.bentobox + bentobox + ${bentobox.version} + provided + + - - ${project.name}-${revision}${build.number} + + ${project.name}-${revision}${build.number} - clean package - - - src/main/resources - true - - - src/main/resources/locales - ./locales - false - - *.yml - - - - src/main/resources/blueprints - ./blueprints - true - - *.json - *.blu - - - - - - org.apache.maven.plugins - maven-clean-plugin - 3.1.0 - - - org.apache.maven.plugins - maven-resources-plugin - 3.1.0 - - - blu - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.7.0 - - ${java.version} - ${java.version} - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.22.0 - - - org.apache.maven.plugins - maven-jar-plugin - 3.1.0 - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.0.1 - - public - false - -Xdoclint:none - - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.0.1 - - - attach-sources - - jar-no-fork - - - - - - org.apache.maven.plugins - maven-install-plugin - 2.5.2 - - - org.apache.maven.plugins - maven-deploy-plugin - 2.8.2 - - - + clean package + + + src/main/resources + true + + + src/main/resources/locales + ./locales + false + + *.yml + + + + src/main/resources/blueprints + ./blueprints + true + + *.json + *.blu + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + blu + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + ${java.version} + ${java.version} + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.0 + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.0.1 + + public + false + -Xdoclint:none + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.0.1 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + org.jacoco + jacoco-maven-plugin + 0.8.3 + + true + + + **/*Names* + + + + + pre-unit-test + + prepare-agent + + + + post-unit-test + + report + + + + + +