diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..9e16544 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,37 @@ +name: Build +on: + push: + branches: + - develop + - master + pull_request: + types: [opened, synchronize, reopened] +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache SonarCloud packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c2ad6fc..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: java -sudo: false -addons: - sonarcloud: - organization: "bentobox-world" - -jdk: - - openjdk8 - - openjdk11 - -matrix: - allow_failures: - - jdk: openjdk11 - -script: - #- sonar-scanner - - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar -Dsonar.projectKey=BentoBoxWorld_Challenges - #- echo "${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" - -cache: - directories: - - '$HOME/.m2/repository' - - '$HOME/.sonar/cache' diff --git a/pom.xml b/pom.xml index 4a91078..e9de1da 100644 --- a/pom.xml +++ b/pom.xml @@ -1,134 +1,138 @@ - 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 - challenges - ${revision} + world.bentobox + challenges + ${revision} - Challenges - Challenges is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like SkyBlock, AcidIsland or CaveBlock. - https://github.com/BentoBoxWorld/Challenges - 2018 + Challenges + Challenges is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like SkyBlock, AcidIsland or CaveBlock. + https://github.com/BentoBoxWorld/Challenges + 2018 - - scm:git:https://github.com/BentoBoxWorld/Challenges.git - scm:git:git@github.com:BentoBoxWorld/Challenges.git - https://github.com/BentoBoxWorld/Challenges - + + scm:git:https://github.com/BentoBoxWorld/Challenges.git + scm:git:git@github.com:BentoBoxWorld/Challenges.git + https://github.com/BentoBoxWorld/Challenges + - - jenkins - http://ci.codemc.org/job/BentoBoxWorld/job/Challenges - + + jenkins + http://ci.codemc.org/job/BentoBoxWorld/job/Challenges + - - GitHub - https://github.com/BentoBoxWorld/Challenges/issues - + + GitHub + https://github.com/BentoBoxWorld/Challenges/issues + - - UTF-8 - UTF-8 - 1.8 - 2.0.2 - - 1.15.2-R0.1-SNAPSHOT - 1.15.4 - 2.5.0 - 1.7 - - ${build.version}-SNAPSHOT - - 0.8.4 - -LOCAL - + + UTF-8 + UTF-8 + 1.8 + 2.0.2 + + 1.15.2-R0.1-SNAPSHOT + 1.15.4 + 2.5.0 + 1.7 + + ${build.version}-SNAPSHOT + + 0.8.4 + -LOCAL + + BentoBoxWorld_Challenges + bentobox-world + https://sonarcloud.io + - - - 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} + + + + + - - - 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 + + - - - spigot-repo - https://hub.spigotmc.org/nexus/content/repositories/snapshots - - - spigotmc-public - https://hub.spigotmc.org/nexus/content/groups/public/ - - - codemc-repo - https://repo.codemc.org/repository/maven-public/ - - - codemc-nms - https://repo.codemc.org/repository/nms/ - - - - vault-repo - http://nexus.hc.to/content/repositories/pub_releases - - - jitpack.io - https://jitpack.io - - + + + spigot-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots + + + spigotmc-public + https://hub.spigotmc.org/nexus/content/groups/public/ + + + codemc-repo + https://repo.codemc.org/repository/maven-public/ + + + codemc-nms + https://repo.codemc.org/repository/nms/ + + + + vault-repo + http://nexus.hc.to/content/repositories/pub_releases + + + jitpack.io + https://jitpack.io + + - - - org.spigotmc - spigot-api - ${spigot.version} - provided - - - org.spigotmc - spigot - ${spigot.version} - provided - + + + org.spigotmc + spigot-api + ${spigot.version} + provided + + + org.spigotmc + spigot + ${spigot.version} + provided + org.mockito @@ -148,167 +152,169 @@ ${powermock.version} test - - world.bentobox - bentobox - ${bentobox.version} - provided - - - world.bentobox - level - ${level.version} - provided - - - net.milkbowl.vault - VaultAPI - ${vault.version} - provided - - + + world.bentobox + bentobox + ${bentobox.version} + provided + + + world.bentobox + level + ${level.version} + provided + + + net.milkbowl.vault + VaultAPI + ${vault.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 - *.json - - - - - - org.apache.maven.plugins - maven-clean-plugin - 3.1.0 - - - org.apache.maven.plugins - maven-resources-plugin - 3.1.0 - - - 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-shade-plugin - 3.2.1 - - true - - - io.github.TheBusyBiscuit.GitHubWebAPI4Java - world.bentobox.bentobox.api.github - - - - - - package - - shade - - - - - - 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.1 - - true - - - - pre-unit-test - - prepare-agent - - - - post-unit-test - - report - - - - - - + clean package + + + src/main/resources + true + + + src/main/resources/locales + ./locales + false + + *.yml + *.json + + + + + + org.apache.maven.plugins + maven-clean-plugin + 3.1.0 + + + org.apache.maven.plugins + maven-resources-plugin + 3.1.0 + + + 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-shade-plugin + 3.2.1 + + true + + + io.github.TheBusyBiscuit.GitHubWebAPI4Java + world.bentobox.bentobox.api.github + + + + + + package + + shade + + + + + + 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.1 + + true + + + + pre-unit-test + + prepare-agent + + + + post-unit-test + + report + + + + + +