nu.studer.gradle.credentials
Class CredentialsPlugin

java.lang.Object
  extended by nu.studer.gradle.credentials.CredentialsPlugin
All Implemented Interfaces:
org.gradle.api.Plugin<org.gradle.api.Project>

public class CredentialsPlugin
extends java.lang.Object
implements org.gradle.api.Plugin<org.gradle.api.Project>

Plugin to store and access encrypted credentials using password-based encryption (PBE). The credentials are stored in the Gradle home directory in a separate file for each passphrase. If no passphrase is provided, a default passphrase is used and the credentials are stored in the default credentials file 'gradle.encrypted.properties'. While running a build, only one passphrase is active per project.

The plugin provides a credentials container through the 'credentials' property that is available from the Gradle project. This allows access to credentials in the form of project.myCredentialKey. The already persisted credentials can be accessed through the credentials container, and new credentials can be added to the container ad-hoc while the build is executed. Credentials added ad-hoc are not available beyond the lifetime of the build.

The plugin adds a task to add credentials and a task to remove credentials.


Field Summary
static java.lang.String ADD_CREDENTIALS_TASK_NAME
           
static java.lang.String CREDENTIALS_CONTAINER_PROPERTY
           
static java.lang.String CREDENTIALS_KEY_PROPERTY
           
static java.lang.String CREDENTIALS_PASSPHRASE_PROPERTY
           
static java.lang.String CREDENTIALS_VALUE_PROPERTY
           
static java.lang.String DEFAULT_PASSPHRASE
           
static java.lang.String DEFAULT_PASSPHRASE_CREDENTIALS_FILE
           
static java.lang.String REMOVE_CREDENTIALS_TASK_NAME
           
 
Constructor Summary
CredentialsPlugin()
           
 
Method Summary
 void apply(org.gradle.api.Project project)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PASSPHRASE_CREDENTIALS_FILE

public static final java.lang.String DEFAULT_PASSPHRASE_CREDENTIALS_FILE
See Also:
Constant Field Values

DEFAULT_PASSPHRASE

public static final java.lang.String DEFAULT_PASSPHRASE
See Also:
Constant Field Values

CREDENTIALS_CONTAINER_PROPERTY

public static final java.lang.String CREDENTIALS_CONTAINER_PROPERTY
See Also:
Constant Field Values

CREDENTIALS_PASSPHRASE_PROPERTY

public static final java.lang.String CREDENTIALS_PASSPHRASE_PROPERTY
See Also:
Constant Field Values

CREDENTIALS_KEY_PROPERTY

public static final java.lang.String CREDENTIALS_KEY_PROPERTY
See Also:
Constant Field Values

CREDENTIALS_VALUE_PROPERTY

public static final java.lang.String CREDENTIALS_VALUE_PROPERTY
See Also:
Constant Field Values

ADD_CREDENTIALS_TASK_NAME

public static final java.lang.String ADD_CREDENTIALS_TASK_NAME
See Also:
Constant Field Values

REMOVE_CREDENTIALS_TASK_NAME

public static final java.lang.String REMOVE_CREDENTIALS_TASK_NAME
See Also:
Constant Field Values
Constructor Detail

CredentialsPlugin

public CredentialsPlugin()
Method Detail

apply

public void apply(org.gradle.api.Project project)
Specified by:
apply in interface org.gradle.api.Plugin<org.gradle.api.Project>