hudson.maven
Class MavenEmbedderUtils

java.lang.Object
  extended by hudson.maven.MavenEmbedderUtils

public class MavenEmbedderUtils
extends Object

Author:
Olivier Lamy

Field Summary
static boolean debug
           
 
Method Summary
static org.codehaus.plexus.classworlds.realm.ClassRealm buildClassRealm(File mavenHome, org.codehaus.plexus.classworlds.ClassWorld world, ClassLoader parentClassLoader)
           build a ClassRealm with all jars in mavenHome/lib/*.jar the ClassRealm is ChildFirst with the current classLoader as parent.
static org.codehaus.plexus.PlexusContainer buildPlexusContainer(ClassLoader mavenClassLoader, ClassLoader parent, MavenRequest mavenRequest)
          used by PomParser in Jenkins
static org.codehaus.plexus.PlexusContainer buildPlexusContainer(File mavenHome, MavenRequest mavenRequest)
           
static MavenInformation getMavenVersion(File mavenHome)
           
static boolean isAtLeastMavenVersion(File mavenHome, String version)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static boolean debug
Method Detail

buildClassRealm

public static org.codehaus.plexus.classworlds.realm.ClassRealm buildClassRealm(File mavenHome,
                                                                               org.codehaus.plexus.classworlds.ClassWorld world,
                                                                               ClassLoader parentClassLoader)
                                                                        throws MavenEmbedderException

build a ClassRealm with all jars in mavenHome/lib/*.jar

the ClassRealm is ChildFirst with the current classLoader as parent.

Parameters:
mavenHome - cannot be null
world - can be null
Returns:
Throws:
MavenEmbedderException

buildPlexusContainer

public static org.codehaus.plexus.PlexusContainer buildPlexusContainer(File mavenHome,
                                                                       MavenRequest mavenRequest)
                                                                throws MavenEmbedderException
Throws:
MavenEmbedderException

buildPlexusContainer

public static org.codehaus.plexus.PlexusContainer buildPlexusContainer(ClassLoader mavenClassLoader,
                                                                       ClassLoader parent,
                                                                       MavenRequest mavenRequest)
                                                                throws MavenEmbedderException
used by PomParser in Jenkins

Parameters:
mavenClassLoader -
parent -
mavenRequest -
Returns:
Throws:
MavenEmbedderException

getMavenVersion

public static MavenInformation getMavenVersion(File mavenHome)
                                        throws MavenEmbedderException
Parameters:
mavenHome -
Returns:
the maven version
Throws:
MavenEmbedderException

isAtLeastMavenVersion

public static boolean isAtLeastMavenVersion(File mavenHome,
                                            String version)
                                     throws MavenEmbedderException
Throws:
MavenEmbedderException


Copyright © 2004-2011. All Rights Reserved.