Package hudson.maven
Class MavenUtil
java.lang.Object
hudson.maven.MavenUtil
- Author:
- Kohsuke Kawaguchi
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic boolean
If set to true, maximize the logging level of Maven embedder. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic hudson.maven.MavenEmbedder
Creates a freshMavenEmbedder
instance.static hudson.maven.MavenEmbedder
createEmbedder
(TaskListener listener, AbstractBuild<?, ?> build) This version tries to infer mavenHome and other options by looking at a build.static hudson.maven.MavenEmbedder
createEmbedder
(TaskListener listener, AbstractProject<?, ?> project, String profiles) This version tries to infer mavenHome by looking at a project.static hudson.maven.MavenEmbedder
createEmbedder
(TaskListener listener, File mavenHome, String profiles) static hudson.maven.MavenEmbedder
createEmbedder
(TaskListener listener, File mavenHome, String profiles, Properties systemProperties) static hudson.maven.MavenEmbedder
createEmbedder
(TaskListener listener, File mavenHome, String profiles, Properties systemProperties, String privateRepository) static hudson.maven.MavenEmbedder
createEmbedder
(TaskListener listener, String profiles) Deprecated.static MavenUtil.MavenVersion
getMavenVersion
(String mavenVersion) static boolean
maven3orLater
(String mavenVersion) static void
resolveModules
(hudson.maven.MavenEmbedder embedder, org.apache.maven.project.MavenProject project, String rel, Map<org.apache.maven.project.MavenProject, String> relativePathInfo, BuildListener listener, boolean nonRecursive) Deprecated.MavenEmbedder has now a method to read all projects Recursively resolves module POMs that are referenced from the givenMavenProject
and parses them intoMavenProject
s.static String
resolveVersion
(String version, org.apache.maven.project.MavenProject project) static boolean
supportEventSpy
(String mavenVersion) support ofEventSpy
only since 3.0.2 due to the current implementation will be supported only for maven 3.1.0
-
Field Details
-
debugMavenEmbedder
public static boolean debugMavenEmbedderIf set to true, maximize the logging level of Maven embedder.
-
-
Constructor Details
-
MavenUtil
public MavenUtil()
-
-
Method Details
-
createEmbedder
public static hudson.maven.MavenEmbedder createEmbedder(TaskListener listener, String profiles) throws hudson.maven.MavenEmbedderException, IOException Deprecated.UsecreateEmbedder(TaskListener, File, String, Properties)
or other overloaded versions that infers maven home.- Throws:
hudson.maven.MavenEmbedderException
IOException
-
createEmbedder
public static hudson.maven.MavenEmbedder createEmbedder(TaskListener listener, AbstractProject<?, ?> project, String profiles) throws hudson.maven.MavenEmbedderException, IOException, InterruptedExceptionThis version tries to infer mavenHome by looking at a project.- Throws:
hudson.maven.MavenEmbedderException
IOException
InterruptedException
- See Also:
-
createEmbedder
public static hudson.maven.MavenEmbedder createEmbedder(TaskListener listener, AbstractBuild<?, ?> build) throws hudson.maven.MavenEmbedderException, IOException, InterruptedExceptionThis version tries to infer mavenHome and other options by looking at a build.- Throws:
hudson.maven.MavenEmbedderException
IOException
InterruptedException
- See Also:
-
createEmbedder
public static hudson.maven.MavenEmbedder createEmbedder(TaskListener listener, File mavenHome, String profiles) throws hudson.maven.MavenEmbedderException, IOException - Throws:
hudson.maven.MavenEmbedderException
IOException
-
createEmbedder
public static hudson.maven.MavenEmbedder createEmbedder(TaskListener listener, File mavenHome, String profiles, Properties systemProperties) throws hudson.maven.MavenEmbedderException, IOException - Throws:
hudson.maven.MavenEmbedderException
IOException
-
createEmbedder
public static hudson.maven.MavenEmbedder createEmbedder(TaskListener listener, File mavenHome, String profiles, Properties systemProperties, String privateRepository) throws hudson.maven.MavenEmbedderException, IOException - Throws:
hudson.maven.MavenEmbedderException
IOException
-
createEmbedder
public static hudson.maven.MavenEmbedder createEmbedder(MavenEmbedderRequest mer) throws hudson.maven.MavenEmbedderException, IOException Creates a freshMavenEmbedder
instance.- Throws:
hudson.maven.MavenEmbedderException
IOException
-
resolveModules
public static void resolveModules(hudson.maven.MavenEmbedder embedder, org.apache.maven.project.MavenProject project, String rel, Map<org.apache.maven.project.MavenProject, String> relativePathInfo, BuildListener listener, boolean nonRecursive) throws org.apache.maven.project.ProjectBuildingException, AbortException, hudson.maven.MavenEmbedderExceptionDeprecated.MavenEmbedder has now a method to read all projects Recursively resolves module POMs that are referenced from the givenMavenProject
and parses them intoMavenProject
s.- Parameters:
rel
- Used to compute the relative path. Pass in "" to begin.relativePathInfo
- Upon the completion of this method, this variable stores the relative path from the root directory of the givenMavenProject
to the root directory of each of the newly parsedMavenProject
.- Throws:
AbortException
- errors will be reported to the listener and the exception thrown.hudson.maven.MavenEmbedderException
- if any embedded issueorg.apache.maven.project.ProjectBuildingException
-
maven3orLater
-
getMavenVersion
-
supportEventSpy
support ofEventSpy
only since 3.0.2 due to the current implementation will be supported only for maven 3.1.0- Parameters:
mavenVersion
- the maven version- Returns:
true
if MavenSpy is supported by this version
-
resolveVersion
-
createEmbedder(TaskListener, File, String, Properties)
or other overloaded versions that infers maven home.