@Mojo(name="nar-integration-test",
defaultPhase=INTEGRATION_TEST,
requiresDependencyResolution=TEST)
public class NarIntegrationTestMojo
extends AbstractDependencyMojo
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.
archiverManager, artifactResolver, excludeArtifactIds, excludeGroupIds, includeArtifactIds, includeGroupIds, remoteArtifactRepositoriesclassifiers, libraries, skipLOG_LEVEL_DEBUG, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_VERBOSE, LOG_LEVEL_WARNING, NAR, NAR_AOL, NAR_EXTENSION, NAR_NO_ARCH, NAR_ROLE_HINT, NAR_TYPE| Constructor and Description |
|---|
NarIntegrationTestMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.maven.shared.artifact.filter.collection.ScopeFilter |
getArtifactScopeFilter()
List the dependencies needed for integration tests executions, those
dependencies are used to declare the paths
of shared and jni libraries in java.library.path
|
protected File |
getUnpackDirectory() |
boolean |
isSkipExec() |
void |
narExecute() |
protected void |
processSystemProperties(boolean setInSystem) |
void |
setSkipExec(boolean skipExec) |
downloadAttachedNars, getAllAttachedNarArtifacts, getArchiverManager, getAttachedNarArtifacts, getBinding, getBindings, getLocalRepository, getNarArtifacts, getNarInfo, getNarManager, getRemoteRepositories, unpackAttachedNarsexecute, getAOL, getArchitecture, getBasedir, getJavah, getJavaHome, getLayout, getLibraries, getLibsName, getLinker, getMavenProject, getMsvc, getNarInfo, getOS, getOutput, getOutputDirectory, getTargetDirectory, getTestTargetDirectory, getTestUnpackDirectory, validateprotected org.apache.maven.shared.artifact.filter.collection.ScopeFilter getArtifactScopeFilter()
getArtifactScopeFilter in class AbstractDependencyMojoprotected File getUnpackDirectory()
getUnpackDirectory in class AbstractNarMojopublic boolean isSkipExec()
public void narExecute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
narExecute in class AbstractNarMojoorg.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprotected void processSystemProperties(boolean setInSystem)
public void setSkipExec(boolean skipExec)
skipExec - the skipExec to setCopyright © 2005-2016 NAR Maven Plugin developers. All Rights Reserved.