Skip to content

Commit

Permalink
Added SonarCloud
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Nov 4, 2019
1 parent 3449169 commit 8507381
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/target/
/.settings/
/.classpath
/.project
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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_MagicCobblestoneGenerator

cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache'
47 changes: 38 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/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">
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">
<modelVersion>4.0.0</modelVersion>

<groupId>world.bentobox</groupId>
Expand Down Expand Up @@ -71,10 +71,34 @@
<properties>
<!-- Override only if necessary -->
<revision>${build.version}</revision>
<!-- Empties build number variable.-->
<!-- Empties build number variable. -->
<build.number></build.number>
</properties>
</profile>
<profile>
<id>sonar</id>
<properties>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.organization>bentobox-world</sonar.organization>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.6.0.1398</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>sonar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<distributionManagement>
Expand All @@ -97,11 +121,11 @@
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public/</url>
</repository>
<!--Vault Repo is down.-->
<!--<repository>-->
<!--<id>vault-repo</id>-->
<!--<url>http://nexus.hc.to/content/repositories/pub_releases</url>-->
<!--</repository>-->
<!--Vault Repo is down. -->
<!--<repository> -->
<!--<id>vault-repo</id> -->
<!--<url>http://nexus.hc.to/content/repositories/pub_releases</url> -->
<!--</repository> -->
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
Expand Down Expand Up @@ -268,9 +292,14 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.1</version>
<version>0.8.3</version>
<configuration>
<append>true</append>
<excludes>
<!-- This is required to prevent Jacoco from adding
synthetic fields to a JavaBean class (causes errors in testing) -->
<exclude>**/*Names*</exclude>
</excludes>
</configuration>
<executions>
<execution>
Expand Down

0 comments on commit 8507381

Please sign in to comment.