public class PluginPropertyUtils extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
PluginPropertyUtils.ConfigurationBuilder<T>
builder responsible for converting Xpp3Dom from Maven to custom object trees.
|
static class |
PluginPropertyUtils.PluginConfigPathParams
Query parameters to convert property containing a dependency list into artifact list.
|
Modifier and Type | Method and Description |
---|---|
static org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator |
createEvaluator(org.apache.maven.project.MavenProject prj)
Evaluator usable for interpolating variables in non resolved (interpolated) models.
|
static org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator |
createEvaluator(Project project)
Evaluator usable for interpolating variables in non resolved (interpolated) models.
|
static List<org.apache.maven.artifact.Artifact> |
getPluginPathProperty(Project project,
PluginPropertyUtils.PluginConfigPathParams query,
boolean transitiveDependencies,
List<org.apache.maven.artifact.resolver.ArtifactResolutionException> errorsOpt)
Converts a list of dependency declarations in the plugin configuration into list of Artifacts.
|
static String |
getPluginProperty(org.apache.maven.project.MavenProject prj,
String groupId,
String artifactId,
String parameter,
String goal)
Deprecated.
use the variant with expressionProperty value
|
static String |
getPluginProperty(org.apache.maven.project.MavenProject prj,
String groupId,
String artifactId,
String parameter,
String goal,
String expressionProperty)
tries to figure out if the property of the given plugin is customized in the
current project and returns it's value if so, otherwise null
|
static String |
getPluginProperty(Project prj,
String groupId,
String artifactId,
String parameter,
String goal)
Deprecated.
use the variant with expressionProperty value
|
static String |
getPluginProperty(Project prj,
String groupId,
String artifactId,
String parameter,
String goal,
String expressionProperty)
tries to figure out if the property of the given plugin is customized in the
current project and returns it's value if so, otherwise null
|
static <T> T |
getPluginPropertyBuildable(org.apache.maven.project.MavenProject prj,
String groupId,
String artifactId,
String goal,
PluginPropertyUtils.ConfigurationBuilder<T> builder)
tries to figure out if the property of the given plugin is customized in
the current project and returns it's value if so, otherwise null
|
static <T> T |
getPluginPropertyBuildable(Project prj,
String groupId,
String artifactId,
String goal,
PluginPropertyUtils.ConfigurationBuilder<T> builder)
tries to figure out if the property of the given plugin is customized in
the current project and returns it's value if so, otherwise null
|
static String[] |
getPluginPropertyList(org.apache.maven.project.MavenProject prj,
String groupId,
String artifactId,
String multiproperty,
String singleproperty,
String goal)
gets the list of values for the given property, if configured in the current project.
|
static String[] |
getPluginPropertyList(Project prj,
String groupId,
String artifactId,
String multiproperty,
String singleproperty,
String goal)
gets the list of values for the given property, if configured in the current project.
|
static Properties |
getPluginPropertyParameter(org.apache.maven.project.MavenProject prj,
String groupId,
String artifactId,
String propertyParameter,
String goal)
Loads name/value pairs from plugin configuration.
|
static Properties |
getPluginPropertyParameter(Project prj,
String groupId,
String artifactId,
String propertyParameter,
String goal)
Loads name/value pairs from plugin configuration.
|
static String |
getPluginVersion(org.apache.maven.project.MavenProject prj,
String groupId,
String artifactId)
tries to figure out if the a plugin is defined in the project
and return the version declared.
|
static String |
getReportPluginProperty(org.apache.maven.project.MavenProject prj,
String groupId,
String artifactId,
String property,
String report)
tries to figure out if the property of the given report plugin is customized in the
current project and returns it's value if so, otherwise null
Please NOTE that if you have access to
Project instance and your MavenProject is the project's own loaded one, then
the variant with Project as parameter is preferable. |
static String |
getReportPluginProperty(Project prj,
String groupId,
String artifactId,
String property,
String report)
tries to figure out if the property of the given report plugin is customized in the
current project and returns it's value if so, otherwise null
|
static String[] |
getReportPluginPropertyList(org.apache.maven.project.MavenProject prj,
String groupId,
String artifactId,
String multiproperty,
String singleproperty,
String goal)
gets the list of values for the given property, if configured in the current project.
|
static String[] |
getReportPluginPropertyList(Project prj,
String groupId,
String artifactId,
String multiproperty,
String singleproperty,
String goal)
gets the list of values for the given property, if configured in the current project.
|
static String |
getReportPluginVersion(org.apache.maven.project.MavenProject prj,
String groupId,
String artifactId)
Like
PluginPropertyUtils.getPluginVersion(org.apache.maven.project.MavenProject, java.lang.String, java.lang.String) but for report plugins. |
@Deprecated @CheckForNull public static String getPluginProperty(@NonNull Project prj, @NonNull String groupId, @NonNull String artifactId, @NonNull String parameter, @NullAllowed String goal)
@CheckForNull public static String getPluginProperty(@NonNull Project prj, @NonNull String groupId, @NonNull String artifactId, @NonNull String parameter, @NullAllowed String goal, @NullAllowed String expressionProperty)
parameter
- the name of the plugin parameter to look forexpressionProperty
- expression property that once defined (and plugin configuration is omited) is used. only value, no ${}@Deprecated @CheckForNull public static String getPluginProperty(@NonNull org.apache.maven.project.MavenProject prj, @NonNull String groupId, @NonNull String artifactId, @NonNull String parameter, @NullAllowed String goal)
Project
instance and your MavenProject
is the project's own loaded one, then
the variant with Project
as parameter is preferable. Faster and less prone to deadlock.@CheckForNull public static String getPluginProperty(@NonNull org.apache.maven.project.MavenProject prj, @NonNull String groupId, @NonNull String artifactId, @NonNull String parameter, @NullAllowed String goal, @NullAllowed String expressionProperty)
parameter
- the name of the plugin parameter to look forexpressionProperty
- expression property that once defined (and plugin configuration is omited) is used. only value, no ${}public static <T> T getPluginPropertyBuildable(@NonNull Project prj, @NonNull String groupId, @NonNull String artifactId, @NullAllowed String goal, @NonNull PluginPropertyUtils.ConfigurationBuilder<T> builder)
public static <T> T getPluginPropertyBuildable(@NonNull org.apache.maven.project.MavenProject prj, @NonNull String groupId, @NonNull String artifactId, @NullAllowed String goal, @NonNull PluginPropertyUtils.ConfigurationBuilder<T> builder)
@CheckForNull public static String getReportPluginProperty(@NonNull Project prj, @NonNull String groupId, @NonNull String artifactId, @NonNull String property, @NullAllowed String report)
@CheckForNull public static String getReportPluginProperty(@NonNull org.apache.maven.project.MavenProject prj, @NonNull String groupId, @NonNull String artifactId, @NonNull String property, @NullAllowed String report)
Project
instance and your MavenProject
is the project's own loaded one, then
the variant with Project
as parameter is preferable. Faster and less prone to deadlock.@CheckForNull public static String getPluginVersion(@NonNull org.apache.maven.project.MavenProject prj, @NonNull String groupId, @NonNull String artifactId)
@CheckForNull public static String getReportPluginVersion(@NonNull org.apache.maven.project.MavenProject prj, @NonNull String groupId, @NonNull String artifactId)
PluginPropertyUtils.getPluginVersion(org.apache.maven.project.MavenProject, java.lang.String, java.lang.String)
but for report plugins.@CheckForNull public static String[] getPluginPropertyList(@NonNull Project prj, @NonNull String groupId, @NonNull String artifactId, @NonNull String multiproperty, @NonNull String singleproperty, @NullAllowed String goal)
multiproperty
- list's root element (eg. "sourceRoots")singleproperty
- - list's single value element (eg. "sourceRoot")@CheckForNull public static String[] getPluginPropertyList(@NonNull org.apache.maven.project.MavenProject prj, @NonNull String groupId, @NonNull String artifactId, @NonNull String multiproperty, @NonNull String singleproperty, @NullAllowed String goal)
Project
instance and your MavenProject
is the project's own loaded one, then
the variant with Project
as parameter is preferable. Faster and less prone to deadlock.multiproperty
- list's root element (eg. "sourceRoots")singleproperty
- - list's single value element (eg. "sourceRoot")@CheckForNull public static String[] getReportPluginPropertyList(@NonNull Project prj, @NonNull String groupId, @NonNull String artifactId, @NonNull String multiproperty, @NonNull String singleproperty, @NullAllowed String goal)
multiproperty
- list's root element (eg. "sourceRoots")singleproperty
- - list's single value element (eg. "sourceRoot")@CheckForNull public static String[] getReportPluginPropertyList(@NonNull org.apache.maven.project.MavenProject prj, @NonNull String groupId, @NonNull String artifactId, @NonNull String multiproperty, @NonNull String singleproperty, @NullAllowed String goal)
Project
instance and your MavenProject
is the project's own loaded one, then
the variant with Project
as parameter is preferable. Faster and less prone to deadlock.multiproperty
- list's root element (eg. "sourceRoots")singleproperty
- - list's single value element (eg. "sourceRoot")@CheckForNull public static Properties getPluginPropertyParameter(@NonNull Project prj, @NonNull String groupId, @NonNull String artifactId, @NonNull String propertyParameter, @NullAllowed String goal)
<params><key>value</key><flag/></params>
produces {key=value, flag=}
(last value is ""
not null
due to Properties
limitation);
<params><param><name>key</name><value>value</value></param></params>
produces {key=value}
.@CheckForNull public static Properties getPluginPropertyParameter(@NonNull org.apache.maven.project.MavenProject prj, @NonNull String groupId, @NonNull String artifactId, @NonNull String propertyParameter, @NullAllowed String goal)
Project
instance and your MavenProject
is the project's own loaded one, then
the variant with Project
as parameter is preferable. Faster and less prone to deadlock.
Two syntaxes are supported:
<params><key>value</key><flag/></params>
produces {key=value, flag=}
(last value is ""
not null
due to Properties
limitation);
<params><param><name>key</name><value>value</value></param></params>
produces {key=value}
.@NonNull public static org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator createEvaluator(@NonNull Project project)
MavenProject
instance accessed viaNbMavenProject.getMavenProject()
@NonNull public static org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator createEvaluator(@NonNull org.apache.maven.project.MavenProject prj)
MavenProject
instance accessed viaNbMavenProject.getMavenProject()
Please NOTE that if you have access to Project
instance, then
the variant with Project
as parameter is preferable. Faster and less prone to deadlock.@CheckForNull public static List<org.apache.maven.artifact.Artifact> getPluginPathProperty(@NonNull Project project, @NonNull PluginPropertyUtils.PluginConfigPathParams query, boolean transitiveDependencies, @NullAllowed List<org.apache.maven.artifact.resolver.ArtifactResolutionException> errorsOpt)
PluginPropertyUtils.PluginConfigPathParams
contains a property
selector and other data to process the dependency list. If `errorsOpt` is not null
, it will receive errors from artifact resolution, if any. Otherwise,
errors are just ignored. The method returns null
if the plugin/execution property is not defined at all.project
- the maven projectquery
- specifies the query for artifacts.transitiveDependencies
- if true, returns also transitive dependencies.errorsOpt
- if not null
, will receive list of errors encountered.null
if the property does not exist