org.apache.maven.shared.runtime
Interface MavenRuntime

All Known Implementing Classes:
DefaultMavenRuntime

public interface MavenRuntime

Provides methods to introspect the current Maven runtime environment.

Version:
$Id: MavenRuntime.java 831910 2009-11-02 15:05:33Z markh $
Author:
Mark Hobson

Field Summary
static String ROLE
          The Plexus role for this component.
 
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.
 

Field Detail

ROLE

static final String ROLE
The Plexus role for this component.

Method Detail

getProjectProperties

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

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

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

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

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

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

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

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

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

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

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

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

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

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.