Class TestJarMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="test-jar",
          defaultPhase=PACKAGE,
          requiresProject=true,
          threadSafe=true,
          requiresDependencyResolution=TEST)
    public class TestJarMojo
    extends AbstractJarMojo
    Build a JAR of the test classes for the current project.
    Version:
    $Id$
    Author:
    Emmanuel Venisse
    • Constructor Detail

      • TestJarMojo

        public TestJarMojo()
    • Method Detail

      • getClassifier

        protected String getClassifier()
        Overload this to produce a jar with another classifier, for example a test-jar.
        Specified by:
        getClassifier in class AbstractJarMojo
        Returns:
        get the classifier.
      • getType

        protected String getType()
        Overload this to produce a test-jar, for example.
        Specified by:
        getType in class AbstractJarMojo
        Returns:
        return the type.
      • getClassesDirectory

        protected File getClassesDirectory()
        Return the specific output directory to serve as the root for the archive.
        Specified by:
        getClassesDirectory in class AbstractJarMojo
        Returns:
        get classes directory.
      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException
        Generates the JAR.
        Specified by:
        execute in interface org.apache.maven.plugin.Mojo
        Overrides:
        execute in class AbstractJarMojo
        Throws:
        org.apache.maven.plugin.MojoExecutionException - in case of an error.