1

I have a library that I want to use Travis-CI on.

It is written in Java and uses Gradle as a build system and deploy to Bintray.

When Travis-CI runs the tests, it fails because I do not store my username and password in plaintext in the git repo.

What went wrong:
A problem occurred evaluating root project 'project-name'.
Could not find property 'bintray_net_user' on com.jfrog.bintray.gradle.BintrayExtension_Decorated@18be0f81.

This is happening because I have not committed my gradle.properties. How to I tell it not to run the deploy code, or otherwise fake it out?

stewsters
  • 4,335
  • 3
  • 15
  • 7

2 Answers2

1

I guess you're usually passing this property using -P commandLine option? The easiest fix for you might be to check if the property is available before you use it and initiate it with a sensible default if not:

if(!project.hasProperty('bintray_net_user')){
    project.ext.bintray_net_user = 'default'
}
Rene Groeschke
  • 27,999
  • 10
  • 69
  • 78
1

You can add user credentials stored to your .travis.yml secure environment variables. Since you always have one of the two (local gradle.properties, or parsed .travis.yml), it will work correctly.

JBaruch
  • 22,610
  • 5
  • 62
  • 90