@Mojo(name="test-jar", defaultPhase=PACKAGE, requiresProject=true, threadSafe=true, requiresDependencyResolution=TEST) public class TestJarMojo extends AbstractJarMojo
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
classifier
Classifier to used for
test-jar . |
private boolean |
skip
Set this to
true to bypass test-jar generation. |
private java.io.File |
testClassesDirectory
Directory containing the test classes and resource files that should be packaged into the JAR.
|
Constructor and Description |
---|
TestJarMojo() |
Modifier and Type | Method and Description |
---|---|
void |
execute()
Generates the JAR.
|
protected java.io.File |
getClassesDirectory()
Return the specific output directory to serve as the root for the archive.
|
protected java.lang.String |
getClassifier()
Overload this to produce a jar with another classifier, for example a test-jar.
|
protected java.lang.String |
getType()
Overload this to produce a test-jar, for example.
|
createArchive, getJarFile, getProject, hasClassifier
@Parameter(property="maven.test.skip") private boolean skip
true
to bypass test-jar generation. Its use is NOT RECOMMENDED, but quite
convenient on occasion.@Parameter(defaultValue="${project.build.testOutputDirectory}", required=true) private java.io.File testClassesDirectory
@Parameter(defaultValue="tests") private java.lang.String classifier
test-jar
.protected java.lang.String getClassifier()
getClassifier
in class AbstractJarMojo
protected java.lang.String getType()
getType
in class AbstractJarMojo
protected java.io.File getClassesDirectory()
getClassesDirectory
in class AbstractJarMojo
public void execute() throws org.apache.maven.plugin.MojoExecutionException
execute
in interface org.apache.maven.plugin.Mojo
execute
in class AbstractJarMojo
org.apache.maven.plugin.MojoExecutionException
- in case of an error.