Where to store passwords / credentials in Gradle Project

Problem Statement

Projects are checked in version control systems like git. You don’t want your credentials to be checked in git too. As such you need a way to easily inject your credentials in your build while keeping it away from prying eye.

Solution

The solution is to store it in ~/.gradle/gradle.properties. This file is not checked in and can be used across all your projects.

Add a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.