Deploy snapshots from Travis
diff --git a/.travis.sh b/.travis.sh
index a332eba..86b1f25 100755
--- a/.travis.sh
+++ b/.travis.sh
@@ -57,7 +57,13 @@
 # TODO(Godin): see https://github.com/jacoco/jacoco/issues/300 about "bytecode.version"
 case "$JDK" in
 5)
-  mvn -V -B -e verify -Djdk.version=1.5 --toolchains=./.travis/toolchains.xml
+  if [[ ${TRAVIS_PULL_REQUEST} == 'false' && ${TRAVIS_BRANCH} == 'master' ]]
+  then
+    # goal "deploy:deploy" used directly instead of "deploy" phase to avoid pollution of Maven repository by "install" phase
+    mvn -V -B -e -f org.jacoco.build verify deploy:deploy -DdeployAtEnd -Djdk.version=1.5 --toolchains=./.travis/toolchains.xml --settings=./.travis/settings.xml
+  else
+    mvn -V -B -e verify -Djdk.version=1.5 --toolchains=./.travis/toolchains.xml
+  fi
   ;;
 6)
   mvn -V -B -e verify -Dbytecode.version=1.6
diff --git a/.travis/settings.xml b/.travis/settings.xml
new file mode 100644
index 0000000..0c27d50
--- /dev/null
+++ b/.travis/settings.xml
@@ -0,0 +1,21 @@
+<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
+  <servers>
+    <server>
+      <id>sonatype-nexus-snapshots</id>
+      <username>${env.SONATYPE_USERNAME}</username>
+      <password>${env.SONATYPE_PASSWORD}</password>
+    </server>
+  </servers>
+  <profiles>
+    <profile>
+      <id>default</id>
+      <properties>
+        <https.protocols>TLSv1</https.protocols>
+      </properties>
+    </profile>
+  </profiles>
+  <activeProfiles>
+    <activeProfile>default</activeProfile>
+  </activeProfiles>
+</settings>