We use Travis to build and deploy artifacts to Maven Central. The repository has 2 branches:
- master - Builds on JDK 8
- 9.0.0 - Builds on JDK 11
In order to define a different JDK, we use the following matrix:
matrix: fast_finish: true include: - jdk: oraclejdk8 if: branch = master - jdk: openjdk11 if: branch = 9.0.0
For every commit made to either of these branches, we build and deploy a snapshot to Maven Central.
For every tag pushed to either of these branch, we want to build and release to Maven Central.
deploy: # Deploy snapshots on every commit made to master and 9.0.0 branch - provider: script script: ./gradlew uploadPublished -PsonatypeUsername=$SONATYPE_USERNAME -PsonatypePassword=$SONATYPE_PASSWORD skip_cleanup: true on: tags: false all_branches: true # Deploy releases on every tag push - provider: script script: sh .ci/deploy.sh skip_cleanup: true on: tags: true
When a commit is pushed to any of these branches, it works fine. However, when we push tags, build isn’t triggered. The request is received by Travis and a request message can be seen in Travis web dashboard: “Build config did not create any jobs”.