Package hudson.maven

Class MavenUtil

java.lang.Object
hudson.maven.MavenUtil

public class MavenUtil extends Object
Author:
Kohsuke Kawaguchi
  • Field Details

    • debugMavenEmbedder

      public static boolean debugMavenEmbedder
      If 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.
      Use createEmbedder(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, InterruptedException
      This 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, InterruptedException
      This 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 fresh MavenEmbedder 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.MavenEmbedderException
      Deprecated.
      MavenEmbedder has now a method to read all projects Recursively resolves module POMs that are referenced from the given MavenProject and parses them into MavenProjects.
      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 given MavenProject to the root directory of each of the newly parsed MavenProject.
      Throws:
      AbortException - errors will be reported to the listener and the exception thrown.
      hudson.maven.MavenEmbedderException - if any embedded issue
      org.apache.maven.project.ProjectBuildingException
    • maven3orLater

      public static boolean maven3orLater(String mavenVersion)
    • getMavenVersion

      public static MavenUtil.MavenVersion getMavenVersion(String mavenVersion)
    • supportEventSpy

      public static boolean supportEventSpy(String mavenVersion)
      support of EventSpy 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

      public static String resolveVersion(String version, org.apache.maven.project.MavenProject project)