|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.maven.shared.test.plugin.ProjectTool
public class ProjectTool
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.
Nested Class Summary | |
---|---|
(package private) static class |
ProjectTool.PomInfo
|
Field Summary | |
---|---|
private org.apache.maven.artifact.factory.ArtifactFactory |
artifactFactory
|
private org.apache.maven.artifact.handler.manager.ArtifactHandlerManager |
artifactHandlerManager
|
private BuildTool |
buildTool
|
static java.lang.String |
INTEGRATION_TEST_DEPLOYMENT_REPO_URL
|
private org.apache.maven.project.MavenProjectBuilder |
projectBuilder
|
private RepositoryTool |
repositoryTool
|
static java.lang.String |
ROLE
|
Constructor Summary | |
---|---|
ProjectTool()
|
Method Summary | |
---|---|
protected ProjectTool.PomInfo |
manglePomForTesting(java.io.File pomFile,
java.lang.String testVersion,
boolean skipUnitTests)
Inject a special version for testing, to allow tests to unambiguously reference the plugin currently under test. |
org.apache.maven.project.MavenProject |
packageProjectArtifact(java.io.File pomFile,
java.lang.String testVersion,
boolean skipUnitTests)
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(java.io.File pomFile,
java.lang.String testVersion,
boolean skipUnitTests,
java.io.File logFile)
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(java.io.File pomFile)
Construct a MavenProject instance from the specified POM file. |
org.apache.maven.project.MavenProject |
readProject(java.io.File pomFile,
java.io.File localRepositoryBasedir)
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 |
readProjectWithDependencies(java.io.File pomFile)
Construct a MavenProject instance from the specified POM file with dependencies. |
org.apache.maven.project.MavenProject |
readProjectWithDependencies(java.io.File pomFile,
java.io.File localRepositoryBasedir)
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 Detail |
---|
public static final java.lang.String ROLE
public static final java.lang.String INTEGRATION_TEST_DEPLOYMENT_REPO_URL
private BuildTool buildTool
private RepositoryTool repositoryTool
private org.apache.maven.project.MavenProjectBuilder projectBuilder
private org.apache.maven.artifact.handler.manager.ArtifactHandlerManager artifactHandlerManager
private org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
Constructor Detail |
---|
public ProjectTool()
Method Detail |
---|
public org.apache.maven.project.MavenProject readProject(java.io.File pomFile) throws TestToolsException
TestToolsException
public org.apache.maven.project.MavenProject readProject(java.io.File pomFile, java.io.File localRepositoryBasedir) throws TestToolsException
TestToolsException
public org.apache.maven.project.MavenProject readProjectWithDependencies(java.io.File pomFile) throws TestToolsException
TestToolsException
public org.apache.maven.project.MavenProject readProjectWithDependencies(java.io.File pomFile, java.io.File localRepositoryBasedir) throws TestToolsException
TestToolsException
public org.apache.maven.project.MavenProject packageProjectArtifact(java.io.File pomFile, java.lang.String testVersion, boolean skipUnitTests) throws TestToolsException
pomFile
- The plugin's POMtestVersion
- 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
.
TestToolsException
public org.apache.maven.project.MavenProject packageProjectArtifact(java.io.File pomFile, java.lang.String testVersion, boolean skipUnitTests, java.io.File logFile) throws TestToolsException
pomFile
- The plugin's POMtestVersion
- 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.
TestToolsException
protected ProjectTool.PomInfo manglePomForTesting(java.io.File pomFile, java.lang.String testVersion, boolean skipUnitTests) throws TestToolsException
maven-surefire-plugin
to allow production of a test-only version of the plugin jar without running unit tests.
pomFile
- The plugin POMtestVersion
- The version that allows test builds to reference the plugin under testskipUnitTests
- If true, configure the surefire plugin to skip unit tests
TestToolsException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |