org.apache.maven.mae.boot.embed
Class MAEEmbedder

java.lang.Object
  extended by org.apache.maven.mae.boot.embed.MAEEmbedder

@Component(role=MAEEmbedder.class)
public class MAEEmbedder
extends Object

The core of the embeddable Maven environment. This class is used as the main interface to the embedded Maven environment for the application developer. The only other interface is component-instance injection, available through the configuration of AbstractMAEApplication subclasses.

Author:
John Casey

Method Summary
protected  void checkStopped()
           
protected  void doExecutionStarting()
           
 String encryptMasterPassword(MAEExecutionRequest request)
          Encrypt the master password that's used to decrypt settings information such as server passwords.
 String encryptPassword(MAEExecutionRequest request)
          Encrypt a password that will be put in the settings.xml file, as for server authentication.
 org.apache.maven.execution.MavenExecutionResult execute(MAEExecutionRequest request)
          Execute a Maven build, using the normal request/response paradigm.
 int formatErrorOutput(MAEExecutionRequest request, org.apache.maven.execution.MavenExecutionResult result)
          Print error output from a Maven execution request, in the familiar format, to the Logger instance used by this embedder.
protected  void injectEnvironment(MAEExecutionRequest request)
           
protected  void injectFromProperties(MAEExecutionRequest request)
           
protected  void injectLogSettings(MAEExecutionRequest request)
           
 com.google.inject.Injector injector()
           
protected  void injectProperties(MAEExecutionRequest request)
           
protected  void injectSettings(MAEExecutionRequest request)
           
protected  void logSummary(org.apache.maven.exception.ExceptionSummary summary, Map<String,String> references, String indent, boolean showErrors)
           
protected  void printInfo(MAEExecutionRequest request)
           
 MAEServiceManager serviceManager()
          Retrieve the MAEServiceManager that was initialized to work with this embedded Maven environment.
static void showInfo(MAEConfiguration config, List<MAELibraryLoader> loaders, PrintStream standardOut)
          Print information about the MAELibrary instances loaded into this environment to the PrintStream parameter.
static void showVersion(MAEConfiguration config, List<MAELibraryLoader> loaders, PrintStream standardOut)
          Print the information about MAELibrary instances loaded, along with version information about this Maven environment in general, to the provided PrintStream parameter.
 void shutdown()
          Perform any shutdown functions associated with this embedder and its component environment.
 Map<Object,Throwable> wire(Object... instances)
          Wire a series of externally managed objects with components from the Maven environment, according to component annotations in those instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

injector

public com.google.inject.Injector injector()
                                    throws MAEEmbeddingException
Throws:
MAEEmbeddingException

wire

public Map<Object,Throwable> wire(Object... instances)
                           throws MAEEmbeddingException
Wire a series of externally managed objects with components from the Maven environment, according to component annotations in those instances.

Throws:
MAEEmbeddingException

checkStopped

protected void checkStopped()

serviceManager

public MAEServiceManager serviceManager()
Retrieve the MAEServiceManager that was initialized to work with this embedded Maven environment.


execute

public org.apache.maven.execution.MavenExecutionResult execute(MAEExecutionRequest request)
                                                        throws MAEEmbeddingException
Execute a Maven build, using the normal request/response paradigm.

Throws:
MAEEmbeddingException

encryptMasterPassword

public String encryptMasterPassword(MAEExecutionRequest request)
                             throws MAEEmbeddingException
Encrypt the master password that's used to decrypt settings information such as server passwords.

Throws:
MAEEmbeddingException

encryptPassword

public String encryptPassword(MAEExecutionRequest request)
                       throws MAEEmbeddingException
Encrypt a password that will be put in the settings.xml file, as for server authentication.

Throws:
MAEEmbeddingException

doExecutionStarting

protected void doExecutionStarting()
                            throws MAEEmbeddingException
Throws:
MAEEmbeddingException

shutdown

public void shutdown()
Perform any shutdown functions associated with this embedder and its component environment.
NOTE: After this method is called, this embedder can no longer be used.


injectEnvironment

protected void injectEnvironment(MAEExecutionRequest request)
                          throws MAEEmbeddingException
Throws:
MAEEmbeddingException

injectFromProperties

protected void injectFromProperties(MAEExecutionRequest request)

injectLogSettings

protected void injectLogSettings(MAEExecutionRequest request)

injectProperties

protected void injectProperties(MAEExecutionRequest request)

injectSettings

protected void injectSettings(MAEExecutionRequest request)
                       throws MAEEmbeddingException
Throws:
MAEEmbeddingException

showInfo

public static void showInfo(MAEConfiguration config,
                            List<MAELibraryLoader> loaders,
                            PrintStream standardOut)
                     throws IOException
Print information about the MAELibrary instances loaded into this environment to the PrintStream parameter.

Throws:
IOException

showVersion

public static void showVersion(MAEConfiguration config,
                               List<MAELibraryLoader> loaders,
                               PrintStream standardOut)
                        throws IOException
Print the information about MAELibrary instances loaded, along with version information about this Maven environment in general, to the provided PrintStream parameter.

Throws:
IOException

printInfo

protected void printInfo(MAEExecutionRequest request)

formatErrorOutput

public int formatErrorOutput(MAEExecutionRequest request,
                             org.apache.maven.execution.MavenExecutionResult result)
Print error output from a Maven execution request, in the familiar format, to the Logger instance used by this embedder.


logSummary

protected void logSummary(org.apache.maven.exception.ExceptionSummary summary,
                          Map<String,String> references,
                          String indent,
                          boolean showErrors)


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