Package io.helidon.build.dev.maven
Class MavenGoalReferenceResolver
- java.lang.Object
-
- io.helidon.build.dev.maven.MavenGoalReferenceResolver
-
public class MavenGoalReferenceResolver extends Object
Utility to map a Maven goal reference to aMavenGoal. References are resolved in the context of the specified project.
References may be fully qualified:
${groupId}:${artifactId}:${version}:${goal}@${executionId}The version will be ignored since it can only be resolved to the plugin configured in the current project. If not provided, a default executionId will be used. For example, with thecompilegoal the default execution id isdefault-compile.
A plugin prefix may be used as an alias for thegroupIdandartifactId, for examplecompilerin the following reference:
compiler:compileFinally, any lifecycle phase (e.g.process-resources) may be used as a reference, and will expand to the corresponding list of goals.
Example References
org.apache.maven.plugins:maven-exec-plugin:3.0.0:exec@compile-sassorg.apache.maven.plugins:maven-exec-plugin:exec@compile-sassexec:exec@compile-sasscompiler:compilecompile
-
-
Constructor Summary
Constructors Constructor Description MavenGoalReferenceResolver(MavenEnvironment environment)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidassertValidPhase(String phase)Asserts that the given phase is valid.List<MavenGoal>resolve(String reference, List<MavenGoal> goals)Resolve a reference.List<MavenGoal>resolve(List<String> references, List<MavenGoal> goals)Resolve a list of references.
-
-
-
Constructor Detail
-
MavenGoalReferenceResolver
public MavenGoalReferenceResolver(MavenEnvironment environment)
Constructor.- Parameters:
environment- The Maven environment.
-
-
Method Detail
-
resolve
public List<MavenGoal> resolve(List<String> references, List<MavenGoal> goals) throws Exception
Resolve a list of references.- Parameters:
references- The references.goals- The goals list to append to.- Returns:
- The goals list.
- Throws:
Exception- If an error occurs.
-
resolve
public List<MavenGoal> resolve(String reference, List<MavenGoal> goals) throws Exception
Resolve a reference.- Parameters:
reference- The reference.goals- The goals list to append to.- Returns:
- The goals list.
- Throws:
Exception- If an error occurs.
-
-