Full name:
org.apache.maven.plugins:maven-nar-plugin:2.1-SNAPSHOT:nar-integration-test
Description:
1. To test a jar file with its native module we can only run after the package phase, so we use the integration-test phase.
2. We need to set java.library.path to an AOL (architecture-os-linker) specific value, but AOL is only known in the NAR plugin and thus cannot be set from the pom.
3. To have the java.library.path definition picked up by java we need the "pertest" forkmode. To use this goal you need to put the test sources in the regular test directories but disable the running of the tests by the maven-surefire-plugin by setting maven.test.skip.exec to false in your pom.
Attributes:
test
.integration-test
.Name | Type | Since | Description |
---|---|---|---|
architecture | String |
- |
The Architecture for the nar, Some choices are: "x86", "i386",
"amd64", "ppc", "sparc", ... Defaults to a derived value from
${os.arch} |
basedir | File |
- |
The base directory of the project being tested. This can be
obtained in your unit test by System.getProperty("basedir"). |
classesDirectory | File |
- |
The directory containing generated classes of the project being
tested. |
failOnError | boolean |
- |
Fail on compilation/linking error. Default value is: true . |
layout | String |
- |
Layout to be used for building and unpacking artifacts Default value is: org.apache.maven.plugin.nar.NarLayout21 . |
libtool | boolean |
- |
Set use of libtool. If set to true, the "libtool " will be
prepended to the command line for compatible processors. Default value is: false . |
runtime | String |
- |
Sets the type of runtime library, possible values "dynamic",
"static". Default value is: dynamic . |
testClassesDirectory | File |
- |
The directory containing generated test classes of the project
being tested. |
testSourceDirectory | File |
2.2 |
The test source directory containing test class sources. |
Name | Type | Since | Description |
---|---|---|---|
additionalClasspathElements | List |
2.4 |
Additional elements to be appended to the classpath. |
aol | String |
- |
Architecture-OS-Linker name. Defaults to: arch-os-linker. |
argLine | String |
2.1 |
Arbitrary JVM options to set on the command line. |
c | C |
- |
C Compiler |
childDelegation | boolean |
2.1 |
When false it makes tests run using the standard classloader
delegation instead of the default Maven isolated classloader. Only
used when forking (forkMode is not "none"). Setting it to false helps with some problems caused by conflicts between xml parsers in the classpath and the Java 5 provider parser. Default value is: false . |
cpp | Cpp |
- |
C++ Compiler |
debugForkedProcess | String |
2.4 |
Attach a debugger to the forked JVM. If set to "true", the process
will suspend and wait for a debugger to attach on port 5005. If set
to some other string, that string will be appended to the argLine,
allowing you to configure arbitrary debuggability options (without
overwriting the other options specified in the argLine). |
disableXmlReport | boolean |
2.2 |
Flag to disable the generation of report files in xml format. Default value is: false . |
enableAssertions | boolean |
2.3.1 |
By default, Surefire enables JVM assertions for the execution of
your test cases. To disable the assertions, set this flag to
false .Default value is: true . |
environmentVariables | Map |
2.1.3 |
Additional environments to set on the command line. |
excludedGroups | String |
2.2 |
(TestNG only) Excluded groups. Any methods/classes/etc with one of
the groups specified in this list will specifically not be run.
This parameter is overridden if suiteXmlFiles are specified. |
excludes | List |
- |
List of patterns (separated by commas) used to specify the tests
that should be excluded in testing. When not specified and when the
test parameter is not specified, the default excludes
will be **/*$* (which excludes all inner classes).
This parameter is ignored if TestNG suiteXmlFiles are specified. |
failIfNoTests | Boolean |
2.4 |
Set this to "true" to cause a failure if there are no tests to run.
Defaults to false. |
forkMode | String |
2.1 |
Option to specify the forking mode. Can be "never", "once" or
"always". "none" and "pertest" are also accepted for backwards
compatibility. Default value is: once . |
forkedProcessTimeoutInSeconds | int |
2.4 |
Kill the forked test process after a certain number of seconds. If
set to 0, wait forever for the process, never timing out. |
fortran | Fortran |
- |
Fortran Compiler |
groups | String |
2.2 |
(TestNG only) Groups for this test. Only classes/methods/etc
decorated with one of the groups specified here will be included in
test run, if specified. This parameter is overridden if
suiteXmlFiles are specified. |
ignore | boolean |
- |
Ignore errors and failures. Default value is: false . |
includes | List |
- |
List of patterns (separated by commas) used to specify the tests
that should be included in testing. When not specified and when the
test parameter is not specified, the default includes
will be **/Test*.java **/*Test.java **/*TestCase.java .
This parameter is ignored if TestNG suiteXmlFiles are specified. |
java | Java |
- |
Java info for includes and linking |
javah | Javah |
- |
Javah info |
junitArtifactName | String |
2.3.1 |
Allows you to specify the name of the JUnit artifact. If not set,
junit:junit will be used.Default value is: junit:junit . |
jvm | String |
2.1 |
Option to specify the jvm (or path to the java executable) to use
with the forking options. For the default, the jvm will be the same
as the one used to run Maven. |
libraries | List |
- |
List of libraries to create |
linker | Linker |
- |
Linker |
maxCores | int |
- |
Maximum number of Cores/CPU's to use. 0 means unlimited. |
os | String |
- |
The Operating System for the nar. Some choices are: "Windows",
"Linux", "MacOSX", "SunOS", ... Defaults to a derived value from
${os.name} FIXME table missing |
output | String |
- |
Name of the output |
parallel | String |
2.2 |
(TestNG only) When you use the parallel attribute, TestNG will try
to run all your test methods in separate threads, except for
methods that depend on each other, which will be run in the same
thread in order to respect their order of execution. |
printSummary | boolean |
- |
Option to print summary of test suites or just print the test cases
that has errors. Default value is: true . |
properties | Properties |
2.4 |
List of properties for configuring all TestNG related
configurations. This is the new preferred method of configuring
TestNG. |
redirectTestOutputToFile | boolean |
2.3 |
When forking, set this to true to redirect the unit test standard
output to a file (found in reportsDirectory/testName-output.txt). Default value is: false . |
remoteRepositories | List |
2.2 |
The plugin remote repositories declared in the pom. |
reportFormat | String |
- |
Selects the formatting for the test report to be generated. Can be
set as brief or plain. Default value is: brief . |
reportsDirectory | File |
- |
Base directory where all reports are written to. |
skip | boolean |
- |
Skip running of NAR plugins (any) altogether. Default value is: false . |
skipNar | boolean |
- |
Skip running of NAR integration test plugin Default value is: false . |
skipNarExec | boolean |
2.3 |
DEPRECATED This old parameter is just like skipTests, but bound to
the old property maven.test.skip.exec. Use -DskipTests instead;
it's shorter. |
skipNarTests | boolean |
2.4 |
Set this to 'true' to skip running tests, but still compile them.
Its use is NOT RECOMMENDED, but quite convenient on occasion. |
suiteXmlFiles | File[] |
2.2 |
(TestNG only) List of TestNG suite xml file locations, seperated by
commas. Note that suiteXmlFiles is incompatible with several other
parameters on this plugin, like includes/excludes. This parameter
is ignored if the "test" parameter is specified (allowing you to
run a single test instead of an entire suite). |
systemProperties | Properties |
- |
List of System properties to pass to the JUnit tests. |
targetDirectory | File |
- |
Target directory for Nar file construction. Defaults to
"${project.build.directory}/nar" for "nar-compile" goal Defaults to
"${project.build.directory}/test-nar" for "nar-testCompile" goal |
test | String |
- |
Specify this parameter to run individual tests by file name,
overriding the includes/excludes parameters. Each
pattern you specify here will be used to create an include pattern
formatted like **/${test}.java , so you can just type
"-Dtest=MyTest" to run a single test called "foo/MyTest.java". This
parameter will override the TestNG suiteXmlFiles parameter. |
testFailureIgnore | boolean |
- |
Set this to true to ignore a failure during testing. Its use is NOT
RECOMMENDED, but quite convenient on occasion. |
testNGArtifactName | String |
2.3.1 |
Allows you to specify the name of the TestNG artifact. If not set,
org.testng:testng will be used.Default value is: org.testng:testng . |
tests | List |
- |
List of tests to create |
threadCount | int |
2.2 |
(TestNG only) The attribute thread-count allows you to specify how
many threads should be allocated for this execution. Only makes
sense to use in conjunction with parallel. |
trimStackTrace | boolean |
2.2 |
Whether to trim the stack trace in the reports to just the lines
within the test, or show the full trace. Default value is: true . |
unpackDirectory | File |
- |
Target directory for Nar file unpacking. Defaults to
"${targetDirectory}/depenencies" |
useFile | boolean |
- |
Option to generate a file test report or just output the test
report to the console. Default value is: true . |
useManifestOnlyJar | boolean |
2.4.3 |
By default, Surefire forks your tests using a manifest-only jar;
set this parameter to "false" to force it to launch your tests with
a plain old Java classpath. (See
http://maven.apache.org/plugins/maven-surefire-plugin/examples/class-loading.html
for a more detailed explanation of manifest-only jars and their
benefits.) Default value is "true". Beware, setting this to "false"
may cause your tests to fail on Windows if your classpath is too
long. Default value is: true . |
useSystemClassLoader | Boolean |
2.3 |
Option to pass dependencies to the system's classloader instead of
using an isolated class loader when forking. Prevents problems with
JDKs which implement the service provider lookup mechanism by using
the system's classloader. Default value is "true". |
workingDirectory | File |
2.1.3 |
Command line working directory. |
java.util.List
2.4
No
aol:
java.lang.String
No
java.lang.String
Yes
${os.arch}
java.lang.String
2.1
No
${argLine}
java.io.File
Yes
${basedir}
c:
org.apache.maven.plugin.nar.C
No
boolean
2.1
No
${childDelegation}
false
java.io.File
Yes
${project.build.outputDirectory}
cpp:
org.apache.maven.plugin.nar.Cpp
No
java.lang.String
2.4
No
${maven.surefire.debug}
boolean
2.2
No
${disableXmlReport}
false
false
.boolean
2.3.1
No
${enableAssertions}
true
java.util.Map
2.1.3
No
java.lang.String
2.2
No
${excludedGroups}
test
parameter is not specified, the default excludes
will be **/*$*
(which excludes all inner classes).
This parameter is ignored if TestNG suiteXmlFiles are specified.java.util.List
No
java.lang.Boolean
2.4
No
${failIfNoTests}
boolean
Yes
true
java.lang.String
2.1
No
${forkMode}
once
forkedProcessTimeoutInSeconds:
int
2.4
No
${surefire.timeout}
org.apache.maven.plugin.nar.Fortran
No
java.lang.String
2.2
No
${groups}
boolean
No
${nar.ignore}
false
test
parameter is not specified, the default includes
will be **/Test*.java **/*Test.java **/*TestCase.java
.
This parameter is ignored if TestNG suiteXmlFiles are specified.java.util.List
No
java:
org.apache.maven.plugin.nar.Java
No
org.apache.maven.plugin.nar.Javah
No
junit:junit
will be used.java.lang.String
2.3.1
No
${junitArtifactName}
junit:junit
jvm:
java.lang.String
2.1
No
${jvm}
java.lang.String
Yes
${nar.layout}
org.apache.maven.plugin.nar.NarLayout21
java.util.List
No
boolean
Yes
false
org.apache.maven.plugin.nar.Linker
No
int
No
os:
java.lang.String
No
java.lang.String
No
${project.artifactId}-${project.version}
java.lang.String
2.2
No
${parallel}
boolean
No
${surefire.printSummary}
true
java.util.Properties
2.4
No
boolean
2.3
No
${nar.test.redirectTestOutputToFile}
false
java.util.List
2.2
No
${project.pluginArtifactRepositories}
java.lang.String
No
${surefire.reportFormat}
brief
java.io.File
No
${project.build.directory}/surefire-reports
java.lang.String
Yes
dynamic
skip:
boolean
No
${nar.skip}
false
boolean
No
${skipNar}
false
boolean
2.3
No
${nar.test.skip.exec}
boolean
2.4
No
${skipNarTests}
java.io.File[]
2.2
No
java.util.Properties
No
java.io.File
No
test:
includes/excludes
parameters. Each
pattern you specify here will be used to create an include pattern
formatted like **/${test}.java
, so you can just type
"-Dtest=MyTest" to run a single test called "foo/MyTest.java". This
parameter will override the TestNG suiteXmlFiles parameter.java.lang.String
No
${test}
java.io.File
Yes
${project.build.testOutputDirectory}
boolean
No
${nar.test.failure.ignore}
org.testng:testng
will be used.java.lang.String
2.3.1
No
${testNGArtifactName}
org.testng:testng
java.io.File
2.2
Yes
${project.build.testSourceDirectory}
java.util.List
No
int
2.2
No
${threadCount}
boolean
2.2
No
${trimStackTrace}
true
java.io.File
No
boolean
No
${surefire.useFile}
true
boolean
2.4.3
No
${surefire.useManifestOnlyJar}
true
java.lang.Boolean
2.3
No
${surefire.useSystemClassLoader}
java.io.File
2.1.3
No
${basedir}