@Mojo(name="build",
defaultPhase=GENERATE_TEST_RESOURCES)
public class BuildMojo
extends org.apache.maven.plugin.AbstractMojo
| Modifier and Type | Field and Description |
|---|---|
private org.codehaus.plexus.archiver.manager.ArchiverManager |
archiverManager |
protected org.apache.maven.artifact.factory.ArtifactFactory |
artifactFactory
Artifact factory, needed to download the package source file
|
protected org.apache.maven.artifact.resolver.ArtifactResolver |
artifactResolver
Artifact resolver, needed to download the package source file
|
private java.util.List<java.lang.String> |
autogenArgs
Extra arguments you want to pass to the autogen.sh command.
|
private java.io.File |
buildDirectory
The directory where the build will be produced.
|
private CLI |
cli |
private java.util.List<java.lang.String> |
configureArgs
Extra arguments you want to pass to the configure command.
|
private boolean |
downloadSourcePackage
If the source build could not be fully generated, perhaps the autotools
were not available on this platform, should we attempt to download
a previously deployed source package and build that?
|
private boolean |
forceAutogen
Should we force executing the autogen.sh file.
|
private boolean |
forceConfigure
Should we force executing the configure command.
|
private java.io.File |
libDirectory
The output directory where the built JNI library will placed.
|
protected org.apache.maven.artifact.repository.ArtifactRepository |
localRepository
Local maven repository.
|
private java.lang.String |
name
The base name of the library, used to determine generated file names.
|
private org.apache.maven.model.Dependency |
nativeSrcDependency
The dependency to download to get the native sources.
|
private java.lang.String |
nativeSrcUrl
URL to where we can down the source package
|
private java.io.File |
packageDirectory
Where the unpacked build package is located.
|
private java.lang.String |
platform
The platform identifier of this build.
|
protected org.apache.maven.project.MavenProject |
project
The maven project.
|
protected java.util.List |
remoteArtifactRepositories
Remote repositories
|
private boolean |
skipAutogen
Should we skip executing the autogen.sh file.
|
private boolean |
skipConfigure
Should we skip executing the configure command.
|
private java.lang.String |
sourceClassifier
The classifier of the package archive that will be created.
|
private boolean |
verbose
Should we display all the native build output?
|
private java.lang.String |
windowsBuildTool
The build tool to use on Windows systems.
|
private java.lang.String |
windowsProjectName
The name of the msbuild/vcbuild project to use.
|
| Constructor and Description |
|---|
BuildMojo() |
| Modifier and Type | Method and Description |
|---|---|
private void |
configureBasedBuild(java.io.File buildDir) |
void |
downloadNativeSourcePackage(java.io.File buildDir) |
void |
execute() |
private java.io.File |
findSourceRoot(java.io.File dest) |
private void |
vsBasedBuild(java.io.File buildDir) |
@Parameter(defaultValue="${project}",
readonly=true)
protected org.apache.maven.project.MavenProject project
@Parameter(defaultValue="${project.remoteArtifactRepositories}",
readonly=true)
protected java.util.List remoteArtifactRepositories
@Parameter(defaultValue="${localRepository}",
readonly=true)
protected org.apache.maven.artifact.repository.ArtifactRepository localRepository
@Component protected org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
@Component protected org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver
@Component private org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager
@Parameter(defaultValue="${project.artifactId}")
private java.lang.String name
@Parameter(defaultValue="${project.build.directory}/generated-sources/hawtjni/native-package")
private java.io.File packageDirectory
@Parameter(defaultValue="${project.build.directory}/generated-sources/hawtjni/lib")
private java.io.File libDirectory
@Parameter(defaultValue="${project.build.directory}")
private java.io.File buildDirectory
@Parameter(defaultValue="${skip-autogen}")
private boolean skipAutogen
@Parameter(defaultValue="${force-autogen}")
private boolean forceAutogen
@Parameter private java.util.List<java.lang.String> autogenArgs
@Parameter(defaultValue="${skip-configure}")
private boolean skipConfigure
@Parameter(defaultValue="${force-configure}")
private boolean forceConfigure
@Parameter(defaultValue="${hawtjni-verbose}")
private boolean verbose
@Parameter private java.util.List<java.lang.String> configureArgs
@Parameter private java.lang.String platform
@Parameter(defaultValue="native-src") private java.lang.String sourceClassifier
@Parameter(defaultValue="true") private boolean downloadSourcePackage
@Parameter private org.apache.maven.model.Dependency nativeSrcDependency
@Parameter(defaultValue="${native-src-url}")
private java.lang.String nativeSrcUrl
@Parameter(defaultValue="detect") private java.lang.String windowsBuildTool
@Parameter private java.lang.String windowsProjectName
private final CLI cli
public void execute()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprivate void vsBasedBuild(java.io.File buildDir)
throws org.codehaus.plexus.util.cli.CommandLineException,
org.apache.maven.plugin.MojoExecutionException,
java.io.IOException
org.codehaus.plexus.util.cli.CommandLineExceptionorg.apache.maven.plugin.MojoExecutionExceptionjava.io.IOExceptionprivate void configureBasedBuild(java.io.File buildDir)
throws java.io.IOException,
org.apache.maven.plugin.MojoExecutionException,
org.codehaus.plexus.util.cli.CommandLineException
java.io.IOExceptionorg.apache.maven.plugin.MojoExecutionExceptionorg.codehaus.plexus.util.cli.CommandLineExceptionpublic void downloadNativeSourcePackage(java.io.File buildDir)
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprivate java.io.File findSourceRoot(java.io.File dest)