@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, dependencyGraphBuilder, excludeArtifactIds, excludeGroupIds, includeArtifactIds, includeGroupIds, remoteArtifactRepositories, rootNodeclassifiers, 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| 构造器和说明 |
|---|
NarIntegrationTestMojo() |
| 限定符和类型 | 方法和说明 |
|---|---|
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) |
dependencyTreeOrderStr, 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 在类中 AbstractDependencyMojoprotected File getUnpackDirectory()
getUnpackDirectory 在类中 AbstractNarMojopublic boolean isSkipExec()
public void narExecute()
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
narExecute 在类中 AbstractNarMojoorg.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureExceptionprotected void processSystemProperties(boolean setInSystem)
public void setSkipExec(boolean skipExec)
skipExec - the skipExec to setCopyright © 2005-2017 NAR Maven Plugin developers. All Rights Reserved.