Fork me on GitHub

credentials:set

Full name:

com.github.genthaler:credentials-maven-plugin:1.3:set

Description:

This plugin looks up credentials in ~/.m2/settings.xml, and sets them to specifiable Maven and/or Java system properties. Also provides the ability to set the username and password via system properties. This is to support situations where the credentials may not be available in all execution environments, such as continuous integration servers. If the computed usernameProperty and/or passwordProperty already exist as either Maven or system properties, neither will be looked up in ~/.m2/settings.xml, since it's assumed that these have been deliberately set in order to override the settings.xml settings.

Attributes:

  • Requires a Maven project to be executed.
  • The goal is thread-safe and supports parallel builds.
  • Binds by default to the lifecycle phase: validate.

Optional Parameters

Name Type Since Description
passwordProperty String - Property to which the password will be set. If not given, it will be set to ${settingsKey}.password.
User property is: credentials.passwordProperty.
settingsKey String - Server id in ~/.m2/settings.xml to look up username/password credentials.
User property is: credentials.settingsKey.
useSystemProperties boolean - Whether to set system properties (as well as the default Maven project properties). This is to support situations where it's not possible or convenient to propagate Maven properties. An example is the Maven AntRun Plugin, where only certain Maven properties are propagated into the Ant project context.
User property is: credentials.useSystemProperties.
usernameProperty String - Property to which the username will be set. If not given, it will be set to ${settingsKey}.username.
User property is: credentials.usernameProperty.

Parameter Details

passwordProperty:

Property to which the password will be set. If not given, it will be set to ${settingsKey}.password.
  • Type: java.lang.String
  • Required: No
  • User Property: credentials.passwordProperty

settingsKey:

Server id in ~/.m2/settings.xml to look up username/password credentials.
  • Type: java.lang.String
  • Required: No
  • User Property: credentials.settingsKey

useSystemProperties:

Whether to set system properties (as well as the default Maven project properties). This is to support situations where it's not possible or convenient to propagate Maven properties. An example is the Maven AntRun Plugin, where only certain Maven properties are propagated into the Ant project context.
  • Type: boolean
  • Required: No
  • User Property: credentials.useSystemProperties

usernameProperty:

Property to which the username will be set. If not given, it will be set to ${settingsKey}.username.
  • Type: java.lang.String
  • Required: No
  • User Property: credentials.usernameProperty