jar:test-jar

Build a JAR of the test classes for the current project.

Mojo Attributes:

  • Requires a Maven 2.0 project to execute.
  • Requires dependency resolution of artifacts in scope: test
  • Automatically executes within the lifecycle phase: package

Required Parameters

Name Type Description
finalName String Name of the generated JAR. Default value is ${project.build.finalName}.
outputDirectory File Directory containing the generated JAR.
testClassesDirectory File Directory containing the test classes.

Optional Parameters

Name Type Description
archive MavenArchiveConfiguration The archive configuration to use. See the documentation for Maven Archiver.
excludes String[] List of files to exclude. Specified as fileset patterns.
forceCreation boolean Whether creating the archive should be forced. Default value is false.
includes String[] List of files to include. Specified as fileset patterns.
projectHelper MavenProjectHelper No description.
skip boolean Set this to true to bypass unit tests entirely. Its use is NOT RECOMMENDED, but quite convenient on occasion.
useDefaultManifestFile boolean Set this to true to enable the use of the defaultManifestFile. Default value is false.

Parameter Details

archive The archive configuration to use. See the documentation for Maven Archiver.
  • Type: org.apache.maven.archiver.MavenArchiveConfiguration
  • Required: No

excludes List of files to exclude. Specified as fileset patterns.
  • Type: java.lang.String[]
  • Required: No

finalName Name of the generated JAR.
  • Type: java.lang.String
  • Required: Yes
  • Expression: ${jar.finalName}
  • Default: ${project.build.finalName}

forceCreation Whether creating the archive should be forced.
  • Type: boolean
  • Required: No
  • Expression: ${jar.forceCreation}
  • Default: false

includes List of files to include. Specified as fileset patterns.
  • Type: java.lang.String[]
  • Required: No

outputDirectory Directory containing the generated JAR.
  • Type: java.io.File
  • Required: Yes
  • Expression: ${project.build.directory}

projectHelper No Description.
  • Type: org.apache.maven.project.MavenProjectHelper
  • Required: No

skip Set this to true to bypass unit tests entirely. Its use is NOT RECOMMENDED, but quite convenient on occasion.
  • Type: boolean
  • Required: No
  • Expression: ${maven.test.skip}

testClassesDirectory Directory containing the test classes.
  • Type: java.io.File
  • Required: Yes
  • Expression: ${project.build.testOutputDirectory}

useDefaultManifestFile Set this to true to enable the use of the defaultManifestFile.
  • Type: boolean
  • Since: 2.2
  • Required: No
  • Expression: ${jar.useDefaultManifestFile}
  • Default: false