Package org.fusesource.hawtjni.maven
Class BuildMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.fusesource.hawtjni.maven.BuildMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="build",
defaultPhase=GENERATE_TEST_RESOURCES)
public class BuildMojo
extends org.apache.maven.plugin.AbstractMojo
This goal builds the JNI module which was previously
generated with the generate goal. It adds the JNI module
to the test resource path so that unit tests can load
the freshly built JNI library.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.codehaus.plexus.archiver.manager.ArchiverManager
protected org.apache.maven.artifact.factory.ArtifactFactory
Artifact factory, needed to download the package source fileprotected org.apache.maven.artifact.resolver.ArtifactResolver
Artifact resolver, needed to download the package source fileExtra arguments you want to pass to the autogen.sh command.private File
The directory where the build will be produced.private final CLI
Extra arguments you want to pass to the configure command.private boolean
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
Should we force executing the autogen.sh file.private boolean
Should we force executing the configure command.private File
The output directory where the built JNI library will placed.protected org.apache.maven.artifact.repository.ArtifactRepository
Local maven repository.private String
The base name of the library, used to determine generated file names.private org.apache.maven.model.Dependency
The dependency to download to get the native sources.private String
URL to where we can down the source packageprivate File
Where the unpacked build package is located.private String
The platform identifier of this build.protected org.apache.maven.project.MavenProject
The maven project.protected List
Remote repositoriesprivate boolean
Should we skip executing the autogen.sh file.private boolean
Should we skip executing the configure command.private String
The classifier of the package archive that will be created.private boolean
Should we display all the native build output?private String
The build tool to use on Windows systems.private String
The name of the msbuild/vcbuild project to use.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
configureBasedBuild
(File buildDir) void
downloadNativeSourcePackage
(File buildDir) void
execute()
private File
findSourceRoot
(File dest) private void
vsBasedBuild
(File buildDir) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
project
@Parameter(defaultValue="${project}", readonly=true) protected org.apache.maven.project.MavenProject projectThe maven project. -
remoteArtifactRepositories
@Parameter(defaultValue="${project.remoteArtifactRepositories}", readonly=true) protected List remoteArtifactRepositoriesRemote repositories -
localRepository
@Parameter(defaultValue="${localRepository}", readonly=true) protected org.apache.maven.artifact.repository.ArtifactRepository localRepositoryLocal maven repository. -
artifactFactory
@Component protected org.apache.maven.artifact.factory.ArtifactFactory artifactFactoryArtifact factory, needed to download the package source file -
artifactResolver
@Component protected org.apache.maven.artifact.resolver.ArtifactResolver artifactResolverArtifact resolver, needed to download the package source file -
archiverManager
@Component private org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager -
name
The base name of the library, used to determine generated file names. -
packageDirectory
@Parameter(defaultValue="${project.build.directory}/generated-sources/hawtjni/native-package") private File packageDirectoryWhere the unpacked build package is located. -
libDirectory
@Parameter(defaultValue="${project.build.directory}/generated-sources/hawtjni/lib") private File libDirectoryThe output directory where the built JNI library will placed. This directory will be added to as a test resource path so that unit tests can verify the built JNI library. The library will placed under the META-INF/native/${platform} directory that the HawtJNI Library uses to find JNI libraries as classpath resources. -
buildDirectory
The directory where the build will be produced. It creates a native-build and native-dist directory under the specified directory. -
skipAutogen
@Parameter(defaultValue="${skip-autogen}") private boolean skipAutogenShould we skip executing the autogen.sh file. -
forceAutogen
@Parameter(defaultValue="${force-autogen}") private boolean forceAutogenShould we force executing the autogen.sh file. -
autogenArgs
Extra arguments you want to pass to the autogen.sh command. -
skipConfigure
@Parameter(defaultValue="${skip-configure}") private boolean skipConfigureShould we skip executing the configure command. -
forceConfigure
@Parameter(defaultValue="${force-configure}") private boolean forceConfigureShould we force executing the configure command. -
verbose
@Parameter(defaultValue="${hawtjni-verbose}") private boolean verboseShould we display all the native build output? -
configureArgs
Extra arguments you want to pass to the configure command. -
platform
The platform identifier of this build. If not specified, it will be automatically detected. -
sourceClassifier
The classifier of the package archive that will be created. -
downloadSourcePackage
@Parameter(defaultValue="true") private boolean downloadSourcePackageIf 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? -
nativeSrcDependency
@Parameter private org.apache.maven.model.Dependency nativeSrcDependencyThe dependency to download to get the native sources. -
nativeSrcUrl
URL to where we can down the source package -
windowsBuildTool
The build tool to use on Windows systems. Set to 'msbuild', 'vcbuild', or 'detect' -
windowsProjectName
The name of the msbuild/vcbuild project to use. Defaults to 'vs2010' for 'msbuild' and 'vs2008' for 'vcbuild'. -
cli
-
-
Constructor Details
-
BuildMojo
public BuildMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
vsBasedBuild
private void vsBasedBuild(File buildDir) throws org.codehaus.plexus.util.cli.CommandLineException, org.apache.maven.plugin.MojoExecutionException, IOException - Throws:
org.codehaus.plexus.util.cli.CommandLineException
org.apache.maven.plugin.MojoExecutionException
IOException
-
configureBasedBuild
private void configureBasedBuild(File buildDir) throws IOException, org.apache.maven.plugin.MojoExecutionException, org.codehaus.plexus.util.cli.CommandLineException - Throws:
IOException
org.apache.maven.plugin.MojoExecutionException
org.codehaus.plexus.util.cli.CommandLineException
-
downloadNativeSourcePackage
public void downloadNativeSourcePackage(File buildDir) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
findSourceRoot
-