├── .buildscript ├── deploy_snapshot.sh └── settings.xml ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── LICENSE.md ├── README.md ├── backo-sample ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── segment │ └── backo │ └── sample │ └── Sample.java ├── backo ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── segment │ │ └── backo │ │ └── Backo.java │ └── test │ └── java │ └── com │ └── segment │ └── backo │ └── BackoTest.java ├── checkstyle.xml ├── deploy_javadoc.sh └── pom.xml /.buildscript/deploy_snapshot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Deploy a jar, source jar, and javadoc jar to Sonatype's snapshot repo. 4 | # 5 | # Adapted from https://coderwall.com/p/9b_lfq and 6 | # http://benlimmer.com/2013/12/26/automatically-publish-javadoc-to-gh-pages-with-travis-ci/ 7 | 8 | SLUG="segmentio/backo-java" 9 | JDK="oraclejdk8" 10 | BRANCH="master" 11 | 12 | set -e 13 | 14 | if [ "$TRAVIS_REPO_SLUG" != "$SLUG" ]; then 15 | echo "Skipping snapshot deployment: wrong repository. Expected '$SLUG' but was '$TRAVIS_REPO_SLUG'." 16 | elif [ "$TRAVIS_JDK_VERSION" != "$JDK" ]; then 17 | echo "Skipping snapshot deployment: wrong JDK. Expected '$JDK' but was '$TRAVIS_JDK_VERSION'." 18 | elif [ "$TRAVIS_PULL_REQUEST" != "false" ]; then 19 | echo "Skipping snapshot deployment: was pull request." 20 | elif [ "$TRAVIS_BRANCH" != "$BRANCH" ]; then 21 | echo "Skipping snapshot deployment: wrong branch. Expected '$BRANCH' but was '$TRAVIS_BRANCH'." 22 | else 23 | echo "Deploying snapshot..." 24 | mvn clean source:jar javadoc:jar deploy --settings=".buildscript/settings.xml" -Dmaven.test.skip=true 25 | echo "Snapshot deployed!" 26 | fi 27 | -------------------------------------------------------------------------------- /.buildscript/settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | sonatype-nexus-snapshots 5 | ${env.CI_DEPLOY_USERNAME} 6 | ${env.CI_DEPLOY_PASSWORD} 7 | 8 | 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io 2 | 3 | ### Maven ### 4 | target/ 5 | pom.xml.tag 6 | pom.xml.releaseBackup 7 | pom.xml.versionsBackup 8 | pom.xml.next 9 | release.properties 10 | 11 | 12 | ### Java ### 13 | *.class 14 | 15 | # Mobile Tools for Java (J2ME) 16 | .mtj.tmp/ 17 | 18 | # Package Files # 19 | *.jar 20 | *.war 21 | *.ear 22 | 23 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 24 | hs_err_pid* 25 | 26 | 27 | ### OSX ### 28 | .DS_Store 29 | .AppleDouble 30 | .LSOverride 31 | 32 | # Icon must end with two \r 33 | Icon 34 | 35 | 36 | # Thumbnails 37 | ._* 38 | 39 | # Files that might appear on external disk 40 | .Spotlight-V100 41 | .Trashes 42 | 43 | # Directories potentially created on remote AFP share 44 | .AppleDB 45 | .AppleDesktop 46 | Network Trash Folder 47 | Temporary Items 48 | .apdisk 49 | 50 | 51 | ### Windows ### 52 | # Windows image file caches 53 | Thumbs.db 54 | ehthumbs.db 55 | 56 | # Folder config file 57 | Desktop.ini 58 | 59 | # Recycle Bin used on file shares 60 | $RECYCLE.BIN/ 61 | 62 | # Windows Installer files 63 | *.cab 64 | *.msi 65 | *.msm 66 | *.msp 67 | 68 | # Windows shortcuts 69 | *.lnk 70 | 71 | 72 | ### Linux ### 73 | *~ 74 | 75 | # KDE directory preferences 76 | .directory 77 | 78 | # Linux trash folder which might appear on any partition or disk 79 | .Trash-* 80 | 81 | ### Intellij ### 82 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm 83 | 84 | *.iml 85 | 86 | ## Directory-based project format: 87 | .idea/ 88 | # if you remove the above rule, at least ignore the following: 89 | 90 | # User-specific stuff: 91 | # .idea/workspace.xml 92 | # .idea/tasks.xml 93 | # .idea/dictionaries 94 | 95 | # Sensitive or high-churn files: 96 | # .idea/dataSources.ids 97 | # .idea/dataSources.xml 98 | # .idea/sqlDataSources.xml 99 | # .idea/dynamic.xml 100 | # .idea/uiDesigner.xml 101 | 102 | # Gradle: 103 | # .idea/gradle.xml 104 | # .idea/libraries 105 | 106 | # Mongo Explorer plugin: 107 | # .idea/mongoSettings.xml 108 | 109 | ## File-based project format: 110 | *.ipr 111 | *.iws 112 | 113 | ## Plugin-specific files: 114 | 115 | # IntelliJ 116 | out/ 117 | 118 | # mpeltonen/sbt-idea plugin 119 | .idea_modules/ 120 | 121 | # JIRA plugin 122 | atlassian-ide-plugin.xml 123 | 124 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | 3 | jdk: 4 | - oraclejdk7 5 | - oraclejdk8 6 | 7 | after_success: 8 | - .buildscript/deploy_snapshot.sh 9 | 10 | env: 11 | global: 12 | - secure: "G3wxinIy6iru1MkidOqE9qINYSlRFDJ8L+whMyis9H6AG0nn6JDmUBhcGl/ZlOUGd4XkxgahLziB8p7k+TnAuWq8ngynptDt4LAcB46cAXNiXM8Zmgx2Tb5oPVAIh+bBbGzeBXA8+OXguSaFBIpWqXN7/OTSRgQE35LT00bbspw=" 13 | - secure: "GquEXZVjgPmc3/aGabWjDUbFYDcs05rbd4VhgTkDD588+90UUJaTjHxE2ucmjdxTq0iUiokprzcVEv1V2T3wQRfW8hK6wsOvBHXdWbirxvtZegs58Tu/cLFvBaSKu9sNfwNBAC+MgLvruXJGuc4GwQNpjxUtiNpq9sofShgvEYo=" 14 | 15 | branches: 16 | except: 17 | - gh-pages 18 | 19 | notifications: 20 | email: false 21 | 22 | sudo: false 23 | 24 | cache: 25 | directories: 26 | - $HOME/.m2 -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Change Log 2 | ========== 3 | 4 | Version 1.0.0 *19-03-2015* 5 | ---------------------------- 6 | 7 | Initial release. 8 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Segment.io, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Backo Java 2 | -------------- 3 | 4 | Exponential backoff for Java (Java port of segmentio/backo). 5 | 6 | 7 | Usage 8 | ----- 9 | 10 | ```java 11 | Backo backo = Backo.builder() 12 | .base(TimeUnit.MILLISECONDS, 1) 13 | .cap(TimeUnit.SECONDS, 1) 14 | .jitter(1) 15 | .factor(2) 16 | .build(); 17 | 18 | for (int i = 0; i < N; i++) { 19 | doWork(); 20 | try { 21 | backo.sleep(); 22 | } catch (InterruptedException e) { 23 | throw e; 24 | } 25 | } 26 | ``` 27 | 28 | 29 | Download 30 | -------- 31 | 32 | Download [the latest JAR][2] or grab via Maven: 33 | 34 | ```xml 35 | 36 | com.segment.backo 37 | backo 38 | 1.0.0 39 | 40 | ``` 41 | or Gradle: 42 | ```groovy 43 | compile 'com.segment.backo:backo:1.0.0' 44 | ``` 45 | 46 | 47 | License 48 | ------- 49 | 50 | ``` 51 | WWWWWW||WWWWWW 52 | W W W||W W W 53 | || 54 | ( OO )__________ 55 | / | \ 56 | /o o| MIT \ 57 | \___/||_||__||_|| * 58 | || || || || 59 | _||_|| _||_|| 60 | (__|__|(__|__| 61 | 62 | The MIT License (MIT) 63 | 64 | Copyright (c) 2014 Segment, Inc. 65 | 66 | Permission is hereby granted, free of charge, to any person obtaining a copy 67 | of this software and associated documentation files (the "Software"), to deal 68 | in the Software without restriction, including without limitation the rights 69 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 70 | copies of the Software, and to permit persons to whom the Software is 71 | furnished to do so, subject to the following conditions: 72 | 73 | The above copyright notice and this permission notice shall be included in all 74 | copies or substantial portions of the Software. 75 | 76 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 77 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 78 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 79 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 80 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 81 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 82 | SOFTWARE. 83 | ``` 84 | 85 | 86 | 87 | [1]: http://github.com/segmentio/backo-java 88 | [2]: http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.segment.backo&a=backo&v=LATEST 89 | -------------------------------------------------------------------------------- /backo-sample/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | 7 | com.segment.backo 8 | backo-parent 9 | 1.0.1-SNAPSHOT 10 | 11 | 12 | backo-sample 13 | Backo Sample 14 | 15 | 16 | 17 | com.segment.backo 18 | backo 19 | ${project.version} 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /backo-sample/src/main/java/com/segment/backo/sample/Sample.java: -------------------------------------------------------------------------------- 1 | package com.segment.backo.sample; 2 | 3 | import com.segment.backo.Backo; 4 | import java.util.concurrent.TimeUnit; 5 | 6 | public class Sample { 7 | private Sample() { 8 | // No instances. 9 | } 10 | 11 | public static void main(String... args) throws Exception { 12 | Backo backo = Backo.builder().base(TimeUnit.MILLISECONDS, 1).jitter(1).factor(2).build(); 13 | 14 | for (int i = 0; i < 30; i++) { 15 | System.out.println(i + ":\tBack off for " + backo.backoff(i) + " ms"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /backo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | 7 | com.segment.backo 8 | backo-parent 9 | 1.0.1-SNAPSHOT 10 | 11 | 12 | backo 13 | Backo 14 | 15 | 16 | 17 | junit 18 | junit 19 | test 20 | 21 | 22 | org.mockito 23 | mockito-core 24 | test 25 | 26 | 27 | org.assertj 28 | assertj-core 29 | test 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /backo/src/main/java/com/segment/backo/Backo.java: -------------------------------------------------------------------------------- 1 | package com.segment.backo; 2 | 3 | /* 4 | * The MIT License (MIT) 5 | * 6 | * Copyright (c) 2014 Segment.io, Inc. 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy 9 | * of this software and associated documentation files (the "Software"), to deal 10 | * in the Software without restriction, including without limitation the rights 11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the Software is 13 | * furnished to do so, subject to the following conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be included in all 16 | * copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 | * SOFTWARE. 25 | */ 26 | 27 | import java.util.concurrent.TimeUnit; 28 | 29 | /** 30 | * Backo implements the "full jitter" backoff policy as described in this article Exponential Backoff And 32 | * Jitter . 33 | *

34 | * Create your own instance with the {@link Builder} class. Instances of backoff are stateless, so 35 | * you can create them once and share them across threads throughout your app. 36 | * 37 | * @see Exponential Backoff And 38 | * Jitter 39 | * 40 | */ 41 | public class Backo { 42 | private static final long DEFAULT_BASE = 100; // 100ms 43 | private static final int DEFAULT_FACTOR = 2; 44 | private static final double DEFAULT_JITTER = 0; 45 | private static final long DEFAULT_CAP = Long.MAX_VALUE; 46 | 47 | private final long base; // in milliseconds 48 | private final int factor; 49 | private final double jitter; 50 | private final long cap; // in milliseconds 51 | 52 | private Backo(long base, int factor, double jitter, long cap) { 53 | this.base = base; 54 | this.factor = factor; 55 | this.jitter = jitter; 56 | this.cap = cap; 57 | } 58 | 59 | /** Return a builder to construct instances of {@link Backo}. */ 60 | public static Builder builder() { 61 | return new Builder(); 62 | } 63 | 64 | /** 65 | * Sleeps for the duration returned by {@link #backoff}. 66 | * 67 | * @throws InterruptedException if any thread has interrupted the current thread. The 68 | * interrupted status of the current thread is 69 | * cleared when this exception is thrown. 70 | */ 71 | public void sleep(int attempt) throws InterruptedException { 72 | Thread.sleep(backoff(attempt)); 73 | } 74 | 75 | /** Return the duration (in milliseconds) for which you should backoff. */ 76 | public long backoff(int attempt) { 77 | long duration = base * (long) Math.pow(factor, attempt); 78 | if (jitter != 0) { 79 | double random = Math.random(); 80 | int deviation = (int) Math.floor(random * jitter * duration); 81 | if ((((int) Math.floor(random * 10)) & 1) == 0) { 82 | duration = duration - deviation; 83 | } else { 84 | duration = duration + deviation; 85 | } 86 | } 87 | if (duration < 0) { 88 | duration = Long.MAX_VALUE; 89 | } 90 | return Math.min(Math.max(duration, base), cap); 91 | } 92 | 93 | /** Fluent API to construct instances of {@link Backo}. */ 94 | public static class Builder { 95 | private long base = DEFAULT_BASE; 96 | private int factor = DEFAULT_FACTOR; 97 | private double jitter = DEFAULT_JITTER; 98 | private long cap = DEFAULT_CAP; 99 | 100 | Builder() { 101 | } 102 | 103 | /** Set the initial backoff interval. Defaults to {@code 100ms}. */ 104 | public Builder base(TimeUnit timeUnit, long duration) { 105 | this.base = timeUnit.toMillis(duration); 106 | return this; 107 | } 108 | 109 | /** 110 | * Set the backoff factor. Defaults to {@code 2}. Using a factor of {@code 2} will back off 111 | * linearly. 112 | */ 113 | public Builder factor(int factor) { 114 | this.factor = factor; 115 | return this; 116 | } 117 | 118 | /** Set the backoff jitter. Defaults to {@code 0}, which represents no jitter. */ 119 | public Builder jitter(int jitter) { 120 | this.jitter = jitter; 121 | return this; 122 | } 123 | 124 | /** Set the maximum backoff. Defaults to {@link Long#MAX_VALUE}. */ 125 | public Builder cap(TimeUnit timeUnit, long duration) { 126 | this.cap = timeUnit.toMillis(duration); 127 | return this; 128 | } 129 | 130 | /** Build a {@link Backo} instance. */ 131 | public Backo build() { 132 | if (cap < base) { 133 | throw new IllegalStateException("Initial backoff cannot be more than maximum."); 134 | } 135 | return new Backo(base, factor, jitter, cap); 136 | } 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /backo/src/test/java/com/segment/backo/BackoTest.java: -------------------------------------------------------------------------------- 1 | package com.segment.backo; 2 | 3 | import java.util.concurrent.TimeUnit; 4 | import org.junit.Test; 5 | 6 | import static org.assertj.core.api.Assertions.assertThat; 7 | 8 | public class BackoTest { 9 | @Test public void backoff() { 10 | Backo backo = new Backo.Builder().build(); 11 | 12 | assertThat(backo.backoff(0)).isEqualTo(100); 13 | assertThat(backo.backoff(1)).isEqualTo(200); 14 | assertThat(backo.backoff(2)).isEqualTo(400); 15 | assertThat(backo.backoff(3)).isEqualTo(800); 16 | 17 | assertThat(backo.backoff(0)).isEqualTo(100); 18 | assertThat(backo.backoff(1)).isEqualTo(200); 19 | } 20 | 21 | @Test public void jittersBetweenBaseAndMin() { 22 | Backo backo = Backo.builder() 23 | .base(TimeUnit.MILLISECONDS, 100) 24 | .jitter(1) 25 | .factor(2) 26 | .cap(TimeUnit.MILLISECONDS, 10000) 27 | .build(); 28 | 29 | for (int i = 0; i < 100; i++) { 30 | assertThat(backo.backoff(i)).isGreaterThanOrEqualTo(100).isLessThanOrEqualTo(10000); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /checkstyle.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /deploy_javadoc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | REPO="git@github.com:segmentio/backo-java.git" 6 | GROUP_ID="com.segment.backo" 7 | ARTIFACT_ID="backo" 8 | 9 | DIR=temp-clone 10 | 11 | # Delete any existing temporary website clone 12 | rm -rf $DIR 13 | 14 | # Clone the current repo into temp folder 15 | git clone $REPO $DIR 16 | 17 | # Move working directory into temp folder 18 | cd $DIR 19 | 20 | # Checkout and track the gh-pages branch 21 | git checkout -t origin/gh-pages 22 | 23 | # Delete everything 24 | rm -rf * 25 | 26 | # Download the latest javadoc 27 | curl -L "http://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=$GROUP_ID&a=$ARTIFACT_ID&v=LATEST&c=javadoc" > javadoc.zip 28 | unzip javadoc.zip 29 | rm javadoc.zip 30 | 31 | # Stage all files in git and create a commit 32 | git add . 33 | git add -u 34 | git commit -m "Website at $(date)" 35 | 36 | # Push the new files up to GitHub 37 | git push origin gh-pages 38 | 39 | # Delete our temp folder 40 | cd .. 41 | rm -rf $DIR 42 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | 6 | 7 | org.sonatype.oss 8 | oss-parent 9 | 7 10 | 11 | 12 | com.segment.backo 13 | backo-parent 14 | 1.0.1-SNAPSHOT 15 | pom 16 | 17 | Backo (Parent) 18 | Exponential backoff (Java port of segmentio/backo). 19 | http://github.com/segmentio/backo-java/ 20 | 2015 21 | 22 | 23 | backo 24 | backo-sample 25 | 26 | 27 | 28 | UTF-8 29 | 30 | 1.6 31 | 4.10 32 | 1.7.0 33 | 1.10.8 34 | 35 | 36 | 37 | http://github.com/segmentio/backo-java/ 38 | scm:git:git://github.com/segmentio/backo-java.git 39 | scm:git:ssh://git@github.com/segmentio/backo-java.git 40 | HEAD 41 | 42 | 43 | 44 | GitHub Issues 45 | http://github.com/segmentio/backo-java/issues 46 | 47 | 48 | 49 | 50 | Apache 2.0 51 | http://www.apache.org/licenses/LICENSE-2.0.txt 52 | 53 | 54 | 55 | 56 | 57 | 58 | junit 59 | junit 60 | ${junit.version} 61 | 62 | 63 | org.assertj 64 | assertj-core 65 | ${assertj.version} 66 | 67 | 68 | org.mockito 69 | mockito-core 70 | ${mockito.version} 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | org.apache.maven.plugins 79 | maven-compiler-plugin 80 | 3.1 81 | 82 | ${java.version} 83 | ${java.version} 84 | true 85 | 86 | 87 | 88 | 89 | org.apache.maven.plugins 90 | maven-checkstyle-plugin 91 | 2.10 92 | 93 | true 94 | checkstyle.xml 95 | true 96 | 97 | 98 | 99 | verify 100 | 101 | checkstyle 102 | 103 | 104 | 105 | 106 | 107 | 108 | org.apache.maven.plugins 109 | maven-release-plugin 110 | 2.4 111 | 112 | true 113 | 114 | 115 | 116 | 117 | 118 | --------------------------------------------------------------------------------