I successfully managed to deploy a JAR from a maven project to Github using tags. However, current configuration assumes that the file name of the JAR always stays the same, which it doesn't. When I do a new release this will change accordingly so deployment will fail.
Is there a way I can use kind of wildcards in the YAML file? From what I found here on Stackoverflow and on the web, wildcards are not supported in YAML. I couldn't find another hack for doing this without manipulating the .travis.yml file itself, which I would like to avoid.
The version string is available in pom.xml
.
Current .travis.yml:
language: java
jdk:
- openjdk7
deploy:
provider: releases
api_key:
secure: asfdsdflkjsdflkj...
file: target/helloci-1.0-SNAPSHOT.jar
on:
repo: ktk/helloci
all_branches: true
tags: true
I could surely script that somehow but then Travis CI would change its own configuration file and I'm not sure if this a) will work and b) is a good idea.
Repo I'm playing with: https://github.com/ktk/helloci
Wildcards are supported now, I run this setup:
A work around is to have maven generate the file using a fixed name, this can be done with
However you probably want to keep the name as per maven conventions if you're not building on travis-ci. You can achieve this by adding the following to your pom:
And passing
-DfinalName=helloci
when executing maven by adding the following 2 lines to your.travis.yml
file:You might also want to add the tag name to the name of the generated file. This can be achieved with:
Sorry, wildcard patterns don't work at the moment, but we'll have a look into making that possible on Travis CI.