Class BuildTool

  • All Implemented Interfaces:
    org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable, org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable

    @Deprecated
    @Component(role=BuildTool.class)
    public class BuildTool
    extends java.lang.Object
    implements org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable, org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable
    Deprecated.
    Test-tool used to execute Maven builds in order to test plugin functionality.
    Version:
    $Id$
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  BuildTool.LoggerHandler
      Deprecated.
       
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.apache.maven.shared.invoker.Invoker mavenInvoker
      Deprecated.
       
      static java.lang.String ROLE
      Deprecated.
      Plexus role
    • Constructor Summary

      Constructors 
      Constructor Description
      BuildTool()
      Deprecated.
       
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      private void closeHandlers​(org.apache.maven.shared.invoker.InvocationRequest request)
      Deprecated.
      If we're logging output to a log file using standard output handlers, make sure these are closed.
      org.apache.maven.shared.invoker.InvocationRequest createBasicInvocationRequest​(java.io.File pom, java.util.Properties properties, java.util.List<java.lang.String> goals, java.io.File buildLogFile)
      Deprecated.
      Construct a standardized InvocationRequest given the test-build POM, a set of CLI properties, a list of goals to execute, and the location of a log file to which build output should be directed.
      void dispose()
      Deprecated.
      Not currently used; when this API switches to use the Maven Embedder, it will be used to shutdown the embedder and its associated container, to free up JVM memory.
      org.apache.maven.shared.invoker.InvocationResult executeMaven​(java.io.File pom, java.util.Properties properties, java.util.List<java.lang.String> goals, java.io.File buildLogFile)
      Deprecated.
      Build a standard InvocationRequest using the specified test-build POM, command-line properties, goals, and output logfile.
      org.apache.maven.shared.invoker.InvocationResult executeMaven​(org.apache.maven.shared.invoker.InvocationRequest request)
      Deprecated.
      Execute a test build using a customized InvocationRequest.
      void initialize()
      Deprecated.
      Initialize this tool once it's been instantiated and composed, in order to start up the MavenInvoker instance.
      private void startInvoker()
      Deprecated.
      Detect the location of the local Maven installation, and start up the MavenInvoker using that path.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ROLE

        public static final java.lang.String ROLE
        Deprecated.
        Plexus role
      • mavenInvoker

        private org.apache.maven.shared.invoker.Invoker mavenInvoker
        Deprecated.
    • Constructor Detail

      • BuildTool

        public BuildTool()
        Deprecated.
    • Method Detail

      • executeMaven

        public org.apache.maven.shared.invoker.InvocationResult executeMaven​(java.io.File pom,
                                                                             java.util.Properties properties,
                                                                             java.util.List<java.lang.String> goals,
                                                                             java.io.File buildLogFile)
                                                                      throws TestToolsException
        Deprecated.
        Build a standard InvocationRequest using the specified test-build POM, command-line properties, goals, and output logfile. Then, execute Maven using this standard request. Return the result of the invocation.
        Parameters:
        pom - The test-build POM
        properties - command-line properties to fine-tune the test build, or test parameter extraction from CLI properties
        goals - The list of goals and/or lifecycle phases to execute during this build
        buildLogFile - The logfile used to capture build output
        Returns:
        The result of the Maven invocation, including exit value and any execution exceptions resulting from the Maven invocation.
        Throws:
        TestToolsException - if any
      • executeMaven

        public org.apache.maven.shared.invoker.InvocationResult executeMaven​(org.apache.maven.shared.invoker.InvocationRequest request)
                                                                      throws TestToolsException
        Deprecated.
        Execute a test build using a customized InvocationRequest. Normally, this request would be created using the createBasicInvocationRequest method in this class.
        Parameters:
        request - The customized InvocationRequest containing the configuration used to execute the current test build
        Returns:
        The result of the Maven invocation, containing exit value, along with any execution exceptions resulting from the [attempted] Maven invocation.
        Throws:
        TestToolsException - if any
      • startInvoker

        private void startInvoker()
                           throws java.io.IOException
        Deprecated.
        Detect the location of the local Maven installation, and start up the MavenInvoker using that path. Detection uses the system property maven.home, and falls back to the shell environment variable M2_HOME.
        Throws:
        java.io.IOException - in case the shell environment variables cannot be read
      • closeHandlers

        private void closeHandlers​(org.apache.maven.shared.invoker.InvocationRequest request)
        Deprecated.
        If we're logging output to a log file using standard output handlers, make sure these are closed.
        Parameters:
        request -
      • createBasicInvocationRequest

        public org.apache.maven.shared.invoker.InvocationRequest createBasicInvocationRequest​(java.io.File pom,
                                                                                              java.util.Properties properties,
                                                                                              java.util.List<java.lang.String> goals,
                                                                                              java.io.File buildLogFile)
        Deprecated.
        Construct a standardized InvocationRequest given the test-build POM, a set of CLI properties, a list of goals to execute, and the location of a log file to which build output should be directed. The resulting InvocationRequest can then be customized by the test class before being used to execute a test build. Both standard-out and standard-error will be directed to the specified log file.
        Parameters:
        pom - The POM for the test build
        properties - The command-line properties for use in this test build
        goals - The goals and/or lifecycle phases to execute during the test build
        buildLogFile - Location to which build output should be logged
        Returns:
        The standardized InvocationRequest for the test build, ready for any necessary customizations.
      • initialize

        public void initialize()
                        throws org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException
        Deprecated.
        Initialize this tool once it's been instantiated and composed, in order to start up the MavenInvoker instance.
        Specified by:
        initialize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable
        Throws:
        org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException - if any
      • dispose

        public void dispose()
        Deprecated.
        Not currently used; when this API switches to use the Maven Embedder, it will be used to shutdown the embedder and its associated container, to free up JVM memory.
        Specified by:
        dispose in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable