Package org.fusesource.hawtjni.maven
Class PackageJarMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.fusesource.hawtjni.maven.PackageJarMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="package-jar", defaultPhase=PREPARE_PACKAGE) public class PackageJarMojo extends org.apache.maven.plugin.AbstractMojo
This goal allows allows you to package the JNI library created by build goal in a JAR which the HawtJNI runtime can unpack when the library needs to be loaded. This platform specific jar is attached with a classifier which matches the current platform.
-
-
Field Summary
Fields Modifier and Type Field Description private org.codehaus.plexus.archiver.manager.ArchiverManager
archiverManager
private boolean
classified
Should a classifier of the native jar be set to match the platform?private java.io.File
libDirectory
The output directory where the built JNI library will placed.private java.lang.String
name
The base name of the library, used to determine generated file names.private java.util.List<java.lang.String>
osgiPlatforms
The osgi platforms that the library match for.private java.lang.String
platform
The platform identifier of this build.protected org.apache.maven.project.MavenProject
project
The maven project.private org.apache.maven.project.MavenProjectHelper
projectHelper
-
Constructor Summary
Constructors Constructor Description PackageJarMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute()
java.lang.String
getNativeCodeValue(Library library)
java.lang.String
getOsgiOSName()
java.lang.String
getOsgiProcessor()
-
-
-
Field Detail
-
project
@Parameter(defaultValue="${project}", readonly=true) protected org.apache.maven.project.MavenProject project
The maven project.
-
name
@Parameter(defaultValue="${project.artifactId}") private java.lang.String name
The base name of the library, used to determine generated file names.
-
archiverManager
@Component private org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager
-
projectHelper
@Component private org.apache.maven.project.MavenProjectHelper projectHelper
-
libDirectory
@Parameter(defaultValue="${project.build.directory}/generated-sources/hawtjni/lib") private java.io.File libDirectory
The 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.
-
platform
@Parameter private java.lang.String platform
The platform identifier of this build. If not specified, it will be automatically detected.
-
classified
@Parameter(defaultValue="true") private boolean classified
Should a classifier of the native jar be set to match the platform?
-
osgiPlatforms
@Parameter private java.util.List<java.lang.String> osgiPlatforms
The osgi platforms that the library match for. Example value: osname=MacOS;processor=x86-64
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getNativeCodeValue
public java.lang.String getNativeCodeValue(Library library)
-
getOsgiOSName
public java.lang.String getOsgiOSName()
-
getOsgiProcessor
public java.lang.String getOsgiProcessor()
-
-