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.ArchiverManagerprotected org.apache.maven.artifact.factory.ArtifactFactoryArtifact factory, needed to download the package source fileprotected org.apache.maven.artifact.resolver.ArtifactResolverArtifact resolver, needed to download the package source fileExtra arguments you want to pass to the autogen.sh command.private FileThe directory where the build will be produced.private final CLIExtra arguments you want to pass to the configure command.private booleanIf 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 booleanShould we force executing the autogen.sh file.private booleanShould we force executing the configure command.private FileThe output directory where the built JNI library will placed.protected org.apache.maven.artifact.repository.ArtifactRepositoryLocal maven repository.private StringThe base name of the library, used to determine generated file names.private org.apache.maven.model.DependencyThe dependency to download to get the native sources.private StringURL to where we can down the source packageprivate FileWhere the unpacked build package is located.private StringThe platform identifier of this build.protected org.apache.maven.project.MavenProjectThe maven project.protected ListRemote repositoriesprivate booleanShould we skip executing the autogen.sh file.private booleanShould we skip executing the configure command.private StringThe classifier of the package archive that will be created.private booleanShould we display all the native build output?private StringThe build tool to use on Windows systems.private StringThe 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 voidconfigureBasedBuild(File buildDir) voiddownloadNativeSourcePackage(File buildDir) voidexecute()private FilefindSourceRoot(File dest) private voidvsBasedBuild(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.CommandLineExceptionorg.apache.maven.plugin.MojoExecutionExceptionIOException
-
configureBasedBuild
private void configureBasedBuild(File buildDir) throws IOException, org.apache.maven.plugin.MojoExecutionException, org.codehaus.plexus.util.cli.CommandLineException - Throws:
IOExceptionorg.apache.maven.plugin.MojoExecutionExceptionorg.codehaus.plexus.util.cli.CommandLineException
-
downloadNativeSourcePackage
public void downloadNativeSourcePackage(File buildDir) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
findSourceRoot
-