Package hudson.maven

Class MavenUtil


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

      • debugMavenEmbedder

        public static boolean debugMavenEmbedder
        If set to true, maximize the logging level of Maven embedder.
    • Constructor Detail

      • MavenUtil

        public MavenUtil()
    • Method Detail

      • 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)
      • 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)