de.smartics.maven.util.project
Class DefaultMavenContext

Package class diagram package DefaultMavenContext
java.lang.Object
  extended by de.smartics.maven.util.project.DefaultMavenContext
All Implemented Interfaces:
MavenContext

public class DefaultMavenContext
     
     
extends Object
implements MavenContext

A simple bean to provide information to services that require some sort of Maven infrastructure. This is something like the Plexus container, but it is not required to have that reference.

Author:
Robert Reiner

Constructor Summary
DefaultMavenContext(Log log, MavenProjectBuilder projectBuilder, ArtifactRepository localRepository, ProfileManager profileManager)
          Constructor that sets the container referenct to null.
DefaultMavenContext(Log log, org.codehaus.plexus.PlexusContainer container, String localRepositoryDirName)
          Default constructor.
 
Method Summary
 org.codehaus.plexus.PlexusContainer getContainer()
          Returns a reference to the plexus container.
 ArtifactRepository getLocalArtifactRepository()
          Returns a reference to the local artifact repository.
 Log getLog()
          Returns the plugin logger.
 ProfileManager getProfileManager()
          Returns a reference to the profile manager.
 MavenProjectBuilder getProjectBuilder()
          Returns a reference to the configured project builder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMavenContext

public DefaultMavenContext(Log log,
                           org.codehaus.plexus.PlexusContainer container,
                           String localRepositoryDirName)
                    throws org.codehaus.plexus.component.repository.exception.ComponentLookupException
Default constructor.

Parameters:
log - the logger provided by the Maven client that is the client to this context.
container - the plexus container with further information to be set.
localRepositoryDirName - the path to the local repository.
Throws:
org.codehaus.plexus.component.repository.exception.ComponentLookupException - if a required component cannot be found.

DefaultMavenContext

public DefaultMavenContext(Log log,
                           MavenProjectBuilder projectBuilder,
                           ArtifactRepository localRepository,
                           ProfileManager profileManager)
Constructor that sets the container referenct to null.

Parameters:
log - the logger provided by the Maven client that is the client to this context.
projectBuilder - the project builder to set.
localRepository - the local artefact repository to set.
profileManager - the profile manager to set.
Method Detail

getLog

public Log getLog()
Returns the plugin logger. Must return not null.

Specified by:
getLog in interface MavenContext
Returns:
the plugin logger.
See Also:
MavenContext.getLog()

getContainer

public org.codehaus.plexus.PlexusContainer getContainer()
Returns a reference to the plexus container. May return null.

Specified by:
getContainer in interface MavenContext
Returns:
the plexus container.
See Also:
MavenContext.getContainer()

getProjectBuilder

public MavenProjectBuilder getProjectBuilder()
Returns a reference to the configured project builder. Must return not null.

Specified by:
getProjectBuilder in interface MavenContext
Returns:
the configured project builder.
See Also:
MavenContext.getProjectBuilder()

getLocalArtifactRepository

public ArtifactRepository getLocalArtifactRepository()
Returns a reference to the local artifact repository. Must return not null.

Specified by:
getLocalArtifactRepository in interface MavenContext
Returns:
the artifact repository.
See Also:
MavenContext.getLocalArtifactRepository()

getProfileManager

public ProfileManager getProfileManager()
Returns a reference to the profile manager. Must return not null.

Specified by:
getProfileManager in interface MavenContext
Returns:
the profile manager.
See Also:
MavenContext.getProfileManager()


Copyright © 2006-2012 Kronseder & Reiner GmbH - smartics. All Rights Reserved.