Class ProjectTool

java.lang.Object
org.apache.maven.shared.test.plugin.ProjectTool

@Deprecated @Component(role=ProjectTool.class) public class ProjectTool extends Object
Deprecated.
Testing tool used to read MavenProject instances from pom.xml files, and to create plugin jar files (package phase of the normal build process) for distribution to a test local repository directory.
Version:
$Id$
Author:
jdcasey
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Deprecated.
     
    static final String
    Deprecated.
    Plexus role
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.apache.maven.shared.test.plugin.ProjectTool.PomInfo
    manglePomForTesting(File pomFile, String testVersion, boolean skipUnitTests)
    Deprecated.
    Inject a special version for testing, to allow tests to unambiguously reference the plugin currently under test.
    org.apache.maven.project.MavenProject
    packageProjectArtifact(File pomFile, String testVersion, boolean skipUnitTests)
    Deprecated.
    Run the plugin's Maven build up to the package phase, in order to produce a jar file for distribution to a test-time local repository.
    org.apache.maven.project.MavenProject
    packageProjectArtifact(File pomFile, String testVersion, boolean skipUnitTests, File logFile)
    Deprecated.
    Run the plugin's Maven build up to the package phase, in order to produce a jar file for distribution to a test-time local repository.
    org.apache.maven.project.MavenProject
    readProject(File pomFile)
    Deprecated.
    Construct a MavenProject instance from the specified POM file.
    org.apache.maven.project.MavenProject
    readProject(File pomFile, File localRepositoryBasedir)
    Deprecated.
    Construct a MavenProject instance from the specified POM file, using the specified local repository directory to resolve ancestor POMs as needed.
    org.apache.maven.project.MavenProject
    Deprecated.
    Construct a MavenProject instance from the specified POM file with dependencies.
    org.apache.maven.project.MavenProject
    readProjectWithDependencies(File pomFile, File localRepositoryBasedir)
    Deprecated.
    Construct a MavenProject instance from the specified POM file with dependencies, using the specified local repository directory to resolve ancestor POMs as needed.

    Methods inherited from class java.lang.Object

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

    • ROLE

      public static final String ROLE
      Deprecated.
      Plexus role
    • INTEGRATION_TEST_DEPLOYMENT_REPO_URL

      public static final String INTEGRATION_TEST_DEPLOYMENT_REPO_URL
      Deprecated.
      See Also:
  • Constructor Details

    • ProjectTool

      public ProjectTool()
      Deprecated.
  • Method Details

    • readProject

      public org.apache.maven.project.MavenProject readProject(File pomFile) throws TestToolsException
      Deprecated.
      Construct a MavenProject instance from the specified POM file.
      Parameters:
      pomFile - current POM file
      Returns:
      the Maven project from a file
      Throws:
      TestToolsException - if any
    • readProject

      public org.apache.maven.project.MavenProject readProject(File pomFile, File localRepositoryBasedir) throws TestToolsException
      Deprecated.
      Construct a MavenProject instance from the specified POM file, using the specified local repository directory to resolve ancestor POMs as needed.
      Parameters:
      pomFile - current POM file
      localRepositoryBasedir -
      Returns:
      the Maven project from a file and a local repo
      Throws:
      TestToolsException - if any
    • readProjectWithDependencies

      public org.apache.maven.project.MavenProject readProjectWithDependencies(File pomFile) throws TestToolsException
      Deprecated.
      Construct a MavenProject instance from the specified POM file with dependencies.
      Parameters:
      pomFile - current POM file
      Returns:
      the Maven project with dependencies from a file
      Throws:
      TestToolsException - if any
    • readProjectWithDependencies

      public org.apache.maven.project.MavenProject readProjectWithDependencies(File pomFile, File localRepositoryBasedir) throws TestToolsException
      Deprecated.
      Construct a MavenProject instance from the specified POM file with dependencies, using the specified local repository directory to resolve ancestor POMs as needed.
      Parameters:
      pomFile - current POM file
      localRepositoryBasedir -
      Returns:
      the Maven project with dependencies from a file and a local repo
      Throws:
      TestToolsException - if any
    • packageProjectArtifact

      public org.apache.maven.project.MavenProject packageProjectArtifact(File pomFile, String testVersion, boolean skipUnitTests) throws TestToolsException
      Deprecated.
      Run the plugin's Maven build up to the package phase, in order to produce a jar file for distribution to a test-time local repository. The testVersion parameter specifies the version to be used in the <version/> element of the plugin configuration, and also in fully qualified, unambiguous goal invocations (as in org.apache.maven.plugins:maven-eclipse-plugin:test:eclipse).
      Parameters:
      pomFile - The plugin's POM
      testVersion - The version to use for testing this plugin. To promote test resiliency, this version should remain unchanged, regardless of what plugin version is under development.
      skipUnitTests - In cases where test builds occur during the unit-testing phase (usually a bad testing smell), the plugin jar must be produced without running unit tests. Otherwise, the testing process will result in a recursive loop of building a plugin jar and trying to unit test it during the build. In these cases, set this flag to true.
      Returns:
      The resulting MavenProject, after the test version and skip flag (for unit tests) have been appropriately configured.
      Throws:
      TestToolsException - if any
    • packageProjectArtifact

      public org.apache.maven.project.MavenProject packageProjectArtifact(File pomFile, String testVersion, boolean skipUnitTests, File logFile) throws TestToolsException
      Deprecated.
      Run the plugin's Maven build up to the package phase, in order to produce a jar file for distribution to a test-time local repository. The testVersion parameter specifies the version to be used in the <version/> element of the plugin configuration, and also in fully qualified, unambiguous goal invocations (as in org.apache.maven.plugins:maven-eclipse-plugin:test:eclipse).
      Parameters:
      pomFile - The plugin's POM
      testVersion - The version to use for testing this plugin. To promote test resiliency, this version should remain unchanged, regardless of what plugin version is under development.
      skipUnitTests - In cases where test builds occur during the unit-testing phase (usually a bad testing smell), the plugin jar must be produced without running unit tests. Otherwise, the testing process will result in a recursive loop of building a plugin jar and trying to unit test it during the build. In these cases, set this flag to true.
      logFile - The file to which build output should be logged, in order to allow later inspection in case this build fails.
      Returns:
      The resulting MavenProject, after the test version and skip flag (for unit tests) have been appropriately configured.
      Throws:
      TestToolsException - if any
    • manglePomForTesting

      protected org.apache.maven.shared.test.plugin.ProjectTool.PomInfo manglePomForTesting(File pomFile, String testVersion, boolean skipUnitTests) throws TestToolsException
      Deprecated.
      Inject a special version for testing, to allow tests to unambiguously reference the plugin currently under test. If test builds will be executed from the unit-testing phase, also inject <skip>true</skip> into the configuration of the maven-surefire-plugin to allow production of a test-only version of the plugin jar without running unit tests.
      Parameters:
      pomFile - The plugin POM
      testVersion - The version that allows test builds to reference the plugin under test
      skipUnitTests - If true, configure the surefire plugin to skip unit tests
      Returns:
      Information about mangled POM, including the temporary file to which it was written.
      Throws:
      TestToolsException - if any