diff --git a/.travis.yml b/.travis.yml index 8283487..6d819fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,15 @@ +dist: trusty + +cache: + directories: + - $HOME/.m2 + +addons: + sonarcloud: + organization: "bordertech-github" + token: + secure: $SONAR_TOKEN + before_install: - echo "MAVEN_OPTS='-Xmx512m -XX:MaxPermSize=128m'" > ~/.mavenrc - mvn clean @@ -9,7 +21,7 @@ jdk: ## Travis installs the project with the following maven command:- "mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V" script: - - mvn package + - mvn package sonar:sonar -Dsonar.projectKey="bordertech-java-taskmaster" ## Send Coverage to Codacy after_success: diff --git a/README.md b/README.md index f3dfb66..5e3a8f7 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,10 @@ Task Master helps run ASYNC tasks. ## Status [![Build Status](https://travis-ci.com/BorderTech/java-taskmaster.svg?branch=master)](https://travis-ci.com/BorderTech/java-taskmaster) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=bordertech-java-taskmaster&metric=alert_status)](https://sonarcloud.io/dashboard?id=bordertech-java-taskmaster) +[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=bordertech-java-taskmaster&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=bordertech-java-taskmaster) +[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=bordertech-java-taskmaster&metric=coverage)](https://sonarcloud.io/dashboard?id=bordertech-java-taskmaster) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/83bcfdba5e34433894e8b958bdb958a5)](https://www.codacy.com/app/BorderTech/java-taskmaster?utm_source=github.com&utm_medium=referral&utm_content=BorderTech/java-taskmaster&utm_campaign=Badge_Grade) -[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/83bcfdba5e34433894e8b958bdb958a5)](https://www.codacy.com/app/BorderTech/java-taskmaster?utm_source=github.com&utm_medium=referral&utm_content=BorderTech/java-taskmaster&utm_campaign=Badge_Coverage) [![Javadocs](https://www.javadoc.io/badge/com.github.bordertech.taskmaster/taskmaster-core.svg)](https://www.javadoc.io/doc/com.github.bordertech.taskmaster/taskmaster-core) [![Maven Central](https://img.shields.io/maven-central/v/com.github.bordertech.taskmaster/taskmaster-core.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.github.bordertech.taskmaster%22%20AND%20a:%22taskmaster-core%22) diff --git a/pom.xml b/pom.xml index fd54c99..7208382 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.github.bordertech.common qa-parent - 1.0.11 + 1.0.15 pom @@ -49,7 +49,7 @@ com.github.bordertech.didums didums-core - 1.0.3 + 1.0.4 @@ -63,14 +63,14 @@ com.github.bordertech.config config - 1.0.3 + 1.0.5 org.slf4j slf4j-api - 1.7.25 + 1.7.26 @@ -84,7 +84,7 @@ javax.cache cache-api - 1.1.0 + 1.1.1 @@ -98,14 +98,14 @@ org.ehcache ehcache - 3.6.3 + 3.7.1 org.apache.commons commons-lang3 - 3.8.1 + 3.9 diff --git a/taskmaster-core/pom.xml b/taskmaster-core/pom.xml index 6f6c115..d1e38c6 100644 --- a/taskmaster-core/pom.xml +++ b/taskmaster-core/pom.xml @@ -20,6 +20,10 @@ Task Master allows a Runnable task to be submitted for execution and returns a Future representing that task. + + ${basedir}/spotbugs-exclude-filter.xml + + diff --git a/taskmaster-core/spotbugs-exclude-filter.xml b/taskmaster-core/spotbugs-exclude-filter.xml new file mode 100644 index 0000000..dcdf31f --- /dev/null +++ b/taskmaster-core/spotbugs-exclude-filter.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/taskmaster-service-helper/src/main/java/com/github/bordertech/taskmaster/service/impl/ServiceHelperProviderDefault.java b/taskmaster-service-helper/src/main/java/com/github/bordertech/taskmaster/service/impl/ServiceHelperProviderDefault.java index c1c7963..b47de05 100644 --- a/taskmaster-service-helper/src/main/java/com/github/bordertech/taskmaster/service/impl/ServiceHelperProviderDefault.java +++ b/taskmaster-service-helper/src/main/java/com/github/bordertech/taskmaster/service/impl/ServiceHelperProviderDefault.java @@ -103,7 +103,11 @@ public synchronized ResultHolde ProcessingMutableResult serviceResult; try { serviceResult = future.get(); - } catch (InterruptedException | ExecutionException e) { + } catch (InterruptedException e) { + // Restore interrupted state... + Thread.currentThread().interrupt(); + throw new AsyncServiceException("Getting result from Future but thread was interrupted. " + e.getMessage(), e); + } catch (ExecutionException e) { throw new AsyncServiceException("Could not get result from the future. " + e.getMessage(), e); } ResultHolder result;