org.apache.maven.shared.runtime
Class DefaultMavenRuntime

java.lang.Object
  extended by org.apache.maven.shared.runtime.DefaultMavenRuntime
All Implemented Interfaces:
MavenRuntime

public class DefaultMavenRuntime
extends Object
implements MavenRuntime

Default implementation of MavenRuntime.

Version:
$Id: DefaultMavenRuntime.java 831910 2009-11-02 15:05:33Z markh $
Author:
Mark Hobson
See Also:
MavenRuntime
Plexus component:
role:
"org.apache.maven.shared.runtime.MavenRuntime"

Field Summary
 
Fields inherited from interface org.apache.maven.shared.runtime.MavenRuntime
ROLE
 
Constructor Summary
DefaultMavenRuntime()
           
 
Method Summary
 MavenProject getProject(Class<?> klass)
          Gets the specified class's Maven project.
 MavenProject getProject(URL url)
          Gets the specified URL's Maven project.
 MavenProjectProperties getProjectProperties(Class<?> klass)
          Gets the properties for the specified class's Maven project.
 MavenProjectProperties getProjectProperties(URL url)
          Gets the properties for the specified URL's Maven project.
 List<MavenProject> getProjects(ClassLoader classLoader)
          Obtains a list of Maven projects accessible from the specified class loader.
 List<MavenProjectProperties> getProjectsProperties(ClassLoader classLoader)
          Obtains a list of basic properties for each Maven project accessible from the specified class loader.
 List<MavenProject> getSortedProjects(ClassLoader classLoader)
          Obtains a list of Maven projects accessible from the specified class loader ordered by their dependencies.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMavenRuntime

public DefaultMavenRuntime()
Method Detail

getProjectProperties

public MavenProjectProperties getProjectProperties(URL url)
                                            throws MavenRuntimeException
Gets the properties for the specified URL's Maven project.

Specified by:
getProjectProperties in interface MavenRuntime
Parameters:
url - the URL to introspect
Returns:
the project properties for the specified URL's Maven project
Throws:
MavenRuntimeException - if an error occurred introspecting the Maven runtime environment

getProjectProperties

public MavenProjectProperties getProjectProperties(Class<?> klass)
                                            throws MavenRuntimeException
Gets the properties for the specified class's Maven project.

Specified by:
getProjectProperties in interface MavenRuntime
Parameters:
klass - the class to introspect
Returns:
the project properties for the specified class's Maven project
Throws:
MavenRuntimeException - if an error occurred introspecting the Maven runtime environment

getProjectsProperties

public List<MavenProjectProperties> getProjectsProperties(ClassLoader classLoader)
                                                   throws MavenRuntimeException
Obtains a list of basic properties for each Maven project accessible from the specified class loader.

Specified by:
getProjectsProperties in interface MavenRuntime
Parameters:
classLoader - the class loader to introspect
Returns:
a list of project properties for each Maven project found within the class path
Throws:
MavenRuntimeException - if an error occurred introspecting the Maven runtime environment

getProject

public MavenProject getProject(URL url)
                        throws MavenRuntimeException
Gets the specified URL's Maven project.

Specified by:
getProject in interface MavenRuntime
Parameters:
url - the URL to introspect
Returns:
the specified URL's Maven project
Throws:
MavenRuntimeException - if an error occurred introspecting the Maven runtime environment

getProject

public MavenProject getProject(Class<?> klass)
                        throws MavenRuntimeException
Gets the specified class's Maven project.

Specified by:
getProject in interface MavenRuntime
Parameters:
klass - the class to introspect
Returns:
the specified class's Maven project
Throws:
MavenRuntimeException - if an error occurred introspecting the Maven runtime environment

getProjects

public List<MavenProject> getProjects(ClassLoader classLoader)
                               throws MavenRuntimeException
Obtains a list of Maven projects accessible from the specified class loader.

Specified by:
getProjects in interface MavenRuntime
Parameters:
classLoader - the class loader to introspect
Returns:
a list of projects for each Maven project found within the class path
Throws:
MavenRuntimeException - if an error occurred introspecting the Maven runtime environment

getSortedProjects

public List<MavenProject> getSortedProjects(ClassLoader classLoader)
                                     throws MavenRuntimeException
Obtains a list of Maven projects accessible from the specified class loader ordered by their dependencies.

Specified by:
getSortedProjects in interface MavenRuntime
Parameters:
classLoader - the class loader to introspect
Returns:
a list of projects for each Maven project found within the class path ordered by their dependencies
Throws:
MavenRuntimeException - if an error occurred introspecting the Maven runtime environment


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.