Enum Class ParameterPolicy
- All Implemented Interfaces:
Serializable,Comparable<ParameterPolicy>,Constable
Controls how the Multibranch Params plugin interacts with parameters that
a Jenkinsfile may declare via its own
properties([parameters([...])]) block.
The plugin injects parameters at scan time; a Jenkinsfile's
properties() call runs at build time and can overwrite that.
This enum lets you choose the right trade-off for your pipeline.
| Mode | At scan time | After a Jenkinsfile build runs |
|---|---|---|
| REPLACE | Always inject plugin params only, ignoring whatever is in the Jenkinsfile. | Jenkinsfile can overwrite at build time; next scan restores plugin params. |
| MERGE_PLUGIN_WINS | Combine both; on a name conflict the plugin's definition takes precedence. | Jenkinsfile can overwrite; next scan merges again. |
| MERGE_JENKINSFILE_WINS | Combine both; on a name conflict the Jenkinsfile's definition is kept. | Jenkinsfile can overwrite; next scan merges again. |
| SKIP_IF_JENKINSFILE | Inject only if the Jenkinsfile has not yet defined its own params. | Once Jenkinsfile has set params, subsequent scans leave them untouched. |
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionMerge plugin parameters with any parameters the Jenkinsfile already declared.Merge plugin parameters with any parameters the Jenkinsfile already declared.Always inject plugin-defined parameters at scan time, replacing whatever the job currently has (including params set by a prior Jenkinsfile build).Inject plugin parameters only when the job does not yet have parameters that were set by a Jenkinsfile build. -
Method Summary
Modifier and TypeMethodDescriptionstatic ParameterPolicyReturns the enum constant of this class with the specified name.static ParameterPolicy[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
REPLACE
Always inject plugin-defined parameters at scan time, replacing whatever the job currently has (including params set by a prior Jenkinsfile build). This is the default. -
MERGE_PLUGIN_WINS
Merge plugin parameters with any parameters the Jenkinsfile already declared. Jenkinsfile-only params are preserved above the banner; on a name conflict the plugin's definition takes precedence. -
MERGE_JENKINSFILE_WINS
Merge plugin parameters with any parameters the Jenkinsfile already declared. Jenkinsfile params are kept as-is; plugin params are only added for names that the Jenkinsfile does not already define. -
SKIP_IF_JENKINSFILE
Inject plugin parameters only when the job does not yet have parameters that were set by a Jenkinsfile build. Once a build has run and the Jenkinsfile'sproperties()call has stored its parameters, subsequent scans will leave those parameters untouched.Detection: the plugin marks its own injections with a
MultiBranchHeaderParametersentinel. If the current job has aParametersDefinitionPropertythat contains no such marker, the parameters are assumed to be Jenkinsfile-owned and are left alone.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-