Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Deploy SNAPSHOTs to Sonatype
  • Loading branch information
leleuj committed Jul 28, 2015
1 parent 1aec723 commit a9240f0
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .travis.yml
Expand Up @@ -20,6 +20,21 @@
before_install:
- mvn -v
- java -version
script: mvn install

language: java

sudo: false

script: "mvn install --settings travis/settings.xml"

jdk:
- oraclejdk7

env:
global:
- secure: "JM/FMiec3GYShrMlJQSW2QG208+V0GCAj2bsP5eF8q4yzgp6o4rT+r57KDIDD6MapRN+G1Pnl3WPcS0aQYnwOhPg4tA2De1bFUPaJltP47eHFfblpjZeHMxcauCQ6BwFFr8yuC0ORsYCW3TOK00Mxq4CRlTlg5iclzHyS/pnkLI="
- secure: "eXfgf3v8Kw/L22DO39Y61os13bfNpop8Xpkmz+HZ1djQWavOkRn58gSg8EVjBYRPOrTuEbhEWb+s3qpx8j3qRdi6roMs9MTr5gEPTAyjTtJ/Zv1qhJ6OlEl2w5c2fRMsk5cB//mtxtZ+qMaz6sdZI2csbQ2xlhjz4AbGQL5i1lY="

after_success:
- chmod -R 777 ./travis/deploy-to-sonatype.sh
- ./travis/deploy-to-sonatype.sh
7 changes: 7 additions & 0 deletions travis/deploy-to-sonatype.sh
@@ -0,0 +1,7 @@
#!/bin/bash

# Only invoke the deployment to Sonatype when it's not a PR and only for master
if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
mvn deploy --settings travis/settings.xml
echo -e "Successfully deployed SNAPSHOT artifacts to Sonatype under Travis job ${TRAVIS_JOB_NUMBER}"
fi
21 changes: 21 additions & 0 deletions 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">
<localRepository/>
<interactiveMode/>
<usePluginRegistry/>
<offline/>
<pluginGroups/>
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<username>${env.SONATYPE_USER}</username>
<password>${env.SONATYPE_PWD}</password>
</server>
</servers>
<mirrors/>
<proxies/>
<profiles/>
<activeProfiles/>
</settings>

0 comments on commit a9240f0

Please sign in to comment.