Package org.apache.maven.plugins.invoker
Class InvokerProperties
- java.lang.Object
-
- org.apache.maven.plugins.invoker.InvokerProperties
-
class InvokerProperties extends java.lang.ObjectProvides a convenient facade around theinvoker.properties.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classInvokerProperties.InvocationPropertyprivate static classInvokerProperties.SelectorProperty
-
Field Summary
Fields Modifier and Type Field Description private java.util.PropertiespropertiesThe invoker properties being wrapped.private static java.lang.StringSELECTOR_PREFIX
-
Constructor Summary
Constructors Constructor Description InvokerProperties(java.util.Properties properties)Creates a new facade for the specified invoker properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigureInvocation(org.apache.maven.shared.invoker.InvocationRequest request, int index)Configures the specified invocation request from these invoker properties.(package private) java.lang.Stringget(java.lang.String key, int index)Gets a value from the invoker properties.private java.lang.Stringget(InvokerProperties.InvocationProperty prop, int index)java.lang.StringgetJobDescription()Gets the description of the corresponding build job.java.lang.StringgetJobName()Gets the name of the corresponding build job.java.lang.StringgetJreVersion()Gets the specification of JRE versions on which this build job should be run.java.lang.StringgetJreVersion(int index)Gets the specification of JRE versions on which this build job should be run.java.lang.StringgetMavenVersion()Gets the specification of Maven versions on which this build job should be run.java.lang.StringgetMavenVersion(int index)intgetOrdinal()Get the corresponding ordinal valuejava.lang.StringgetOsFamily()Gets the specification of OS families on which this build job should be run.java.lang.StringgetOsFamily(int index)Gets the specification of OS families on which this build job should be run.java.util.PropertiesgetProperties()Gets the invoker properties being wrapped.java.lang.StringgetSettingsFile(int index)Gets the settings file used for the specified invocation.java.lang.StringgetSystemPropertiesFile(int index)Gets the path to the properties file used to set the system properties for the specified invocation.intgetTimeoutInSeconds(int index)Get timeout to execute the projectjava.util.Collection<InvokerToolchain>getToolchains()java.util.Collection<InvokerToolchain>getToolchains(int index)private java.util.Collection<InvokerToolchain>getToolchains(java.util.regex.Pattern p)booleanisExpectedResult(int exitCode, int index)Checks whether the specified exit code matches the one expected for the given invocation.booleanisInvocationDefined(int index)Determines whether these invoker properties contain a build definition for the specified invocation index.booleanisSelectorDefined(int index)Determines whether these invoker properties contain a build definition for the specified selector index.
-
-
-
Field Detail
-
SELECTOR_PREFIX
private static final java.lang.String SELECTOR_PREFIX
- See Also:
- Constant Field Values
-
properties
private final java.util.Properties properties
The invoker properties being wrapped.
-
-
Constructor Detail
-
InvokerProperties
InvokerProperties(java.util.Properties properties)
Creates a new facade for the specified invoker properties. The properties will not be copied, so any changes to them will be reflected by the facade.- Parameters:
properties- The invoker properties to wrap, may benullif none.
-
-
Method Detail
-
getProperties
public java.util.Properties getProperties()
Gets the invoker properties being wrapped.- Returns:
- The invoker properties being wrapped, never
null.
-
getJobName
public java.lang.String getJobName()
Gets the name of the corresponding build job.- Returns:
- The name of the build job or an empty string if not set.
-
getJobDescription
public java.lang.String getJobDescription()
Gets the description of the corresponding build job.- Returns:
- The description of the build job or an empty string if not set.
-
getOrdinal
public int getOrdinal()
Get the corresponding ordinal value- Returns:
- The ordinal value
-
getJreVersion
public java.lang.String getJreVersion()
Gets the specification of JRE versions on which this build job should be run.- Returns:
- The specification of JRE versions or an empty string if not set.
-
getJreVersion
public java.lang.String getJreVersion(int index)
Gets the specification of JRE versions on which this build job should be run.- Returns:
- The specification of JRE versions or an empty string if not set.
-
getMavenVersion
public java.lang.String getMavenVersion()
Gets the specification of Maven versions on which this build job should be run.- Returns:
- The specification of Maven versions on which this build job should be run.
- Since:
- 1.5
-
getMavenVersion
public java.lang.String getMavenVersion(int index)
- Parameters:
index- the selector index- Returns:
- The specification of Maven versions on which this build job should be run.
- Since:
- 3.0.0
-
getOsFamily
public java.lang.String getOsFamily()
Gets the specification of OS families on which this build job should be run.- Returns:
- The specification of OS families or an empty string if not set.
-
getOsFamily
public java.lang.String getOsFamily(int index)
Gets the specification of OS families on which this build job should be run.- Parameters:
index- the selector index- Returns:
- The specification of OS families or an empty string if not set.
- Since:
- 3.0.0
-
getToolchains
public java.util.Collection<InvokerToolchain> getToolchains()
-
getToolchains
public java.util.Collection<InvokerToolchain> getToolchains(int index)
-
getToolchains
private java.util.Collection<InvokerToolchain> getToolchains(java.util.regex.Pattern p)
-
isInvocationDefined
public boolean isInvocationDefined(int index)
Determines whether these invoker properties contain a build definition for the specified invocation index.- Parameters:
index- The one-based index of the invocation to check for, must not be negative.- Returns:
trueif the invocation with the specified index is defined,falseotherwise.
-
isSelectorDefined
public boolean isSelectorDefined(int index)
Determines whether these invoker properties contain a build definition for the specified selector index.- Parameters:
index- the index- Returns:
trueif the selector with the specified index is defined,falseotherwise.- Since:
- 3.0.0
-
configureInvocation
public void configureInvocation(org.apache.maven.shared.invoker.InvocationRequest request, int index)Configures the specified invocation request from these invoker properties. Settings not present in the invoker properties will be left unchanged in the invocation request.- Parameters:
request- The invocation request to configure, must not benull.index- The one-based index of the invocation to configure, must not be negative.
-
isExpectedResult
public boolean isExpectedResult(int exitCode, int index)Checks whether the specified exit code matches the one expected for the given invocation.- Parameters:
exitCode- The exit code of the Maven invocation to check.index- The index of the invocation for which to check the exit code, must not be negative.- Returns:
trueif the exit code is zero and a success was expected or if the exit code is non-zero and a failue was expected,falseotherwise.
-
getSystemPropertiesFile
public java.lang.String getSystemPropertiesFile(int index)
Gets the path to the properties file used to set the system properties for the specified invocation.- Parameters:
index- The index of the invocation, must not be negative.- Returns:
- The path to the properties file or
nullif not set.
-
getSettingsFile
public java.lang.String getSettingsFile(int index)
Gets the settings file used for the specified invocation.- Parameters:
index- The index of the invocation, must not be negative.- Returns:
- the value for the settings file or
nullif not set.
-
getTimeoutInSeconds
public int getTimeoutInSeconds(int index)
Get timeout to execute the project- Parameters:
index- index The index of the invocation, must not be negative.- Returns:
- the value for the timeout or -1
-
get
java.lang.String get(java.lang.String key, int index)Gets a value from the invoker properties. The invoker properties are intended to describe the invocation settings for multiple builds of the same project. For this reason, the properties are indexed. First, a property namedkey.indexwill be queried. If this property does not exist, the value of the property namedkeywill finally be returned.- Parameters:
key- The (base) key for the invoker property to lookup, must not benull.index- The index of the invocation for which to retrieve the value, must not be negative.- Returns:
- The value for the requested invoker property or
nullif not defined.
-
get
private java.lang.String get(InvokerProperties.InvocationProperty prop, int index)
-
-