Class BuildMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.bytedeco.javacpp.tools.BuildMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
ParseMojo

@Mojo(name="build", defaultPhase=PROCESS_CLASSES, threadSafe=true) public class BuildMojo extends org.apache.maven.plugin.AbstractMojo
A Maven Mojo to call the Builder (C++ header file -> Java class -> C++ JNI -> native library). Can also be considered as an example of how to use the Builder programmatically.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) String[]
    Execute a build command instead of JavaCPP itself, and return.
    (package private) String
    Add the path to the "platform.buildpath" property.
    (package private) String[]
    Add the paths to the "platform.buildpath" property.
    (package private) String
    Add the path to the "platform.buildresource" property.
    (package private) String[]
    Add the paths to the "platform.buildresource" property.
    (package private) String
    Process only this class or package (suffixed with .* or .**).
    (package private) String[]
    Process only these classes or packages (suffixed with .* or .**).
    (package private) String
    Load user classes from classPath.
    (package private) String[]
    Load user classes from classPaths.
    (package private) boolean
    Delete all files from outputDirectory before generating anything in it.
    (package private) boolean
    Compile and delete the generated .cpp files.
    (package private) String[]
    Pass compilerOptions directly to compiler.
    (package private) String
    Also create config files for GraalVM native-image in directory.
    (package private) boolean
    Copy to output directory dependent libraries (link and preload).
    (package private) boolean
    Copy to output directory resources listed in properties.
    (package private) boolean
    Delete generated C++ JNI files after compilation
    (package private) String
    Specify the character encoding used for input and output.
    (package private) Map<String,String>
    Add environment variables to the compiler subprocess.
    (package private) String
    Add the path to the "platform.executablepath" property.
    (package private) String[]
    Add the paths to the "platform.executablepath" property.
    (package private) boolean
    Generate .cpp files from Java interfaces if found, parsing from header files if not.
    (package private) boolean
    Generate header file with declarations of callbacks functions.
    (package private) String
    Add the path to the "platform.includepath" property.
    (package private) String[]
    Add the paths to the "platform.includepath" property.
    (package private) String
    Add the path to the "platform.includeresource" property.
    (package private) String[]
    Add the paths to the "platform.includeresource" property.
    (package private) String
    Also create a JAR file named <jarPrefix>-<platform>.jar.
    (package private) String
    Add the path to the "platform.linkpath" property.
    (package private) String[]
    Add the paths to the "platform.linkpath" property.
    (package private) String
    Add the path to the "platform.linkresource" property.
    (package private) String[]
    Add the paths to the "platform.linkresource" property.
    (package private) File
    Output all generated files to outputDirectory.
    (package private) String
    Output everything in a file named after given outputName.
    (package private) org.apache.maven.plugin.descriptor.PluginDescriptor
     
    (package private) String
    Add the path to the "platform.preloadpath" property.
    (package private) String[]
    Add the paths to the "platform.preloadpath" property.
    (package private) String
    Add the path to the "platform.preloadresource" property.
    (package private) String[]
    Add the paths to the "platform.preloadresource" property.
    (package private) org.apache.maven.project.MavenProject
     
    (package private) String
    Load all properties from resource.
    (package private) File
    Load all properties from file.
    (package private) Properties
    Set property keys to values.
    (package private) String
    Add the path to the "platform.resourcepath" property.
    (package private) String[]
    Add the paths to the "platform.resourcepath" property.
    (package private) boolean
    Skip the execution.
    (package private) String[]
    Add to Maven project source directory of Java files generated by buildCommand.
    (package private) String
    Add to Maven project source directory of Java files generated by buildCommand.
    (package private) File
    Set the working directory of the build subprocess.

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    (package private) static String[]
    merge(String[] ss, String s)
     

    Methods inherited from class org.apache.maven.plugin.AbstractMojo

    getLog, getPluginContext, setLog, setPluginContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • classPath

      @Parameter(property="javacpp.classPath", defaultValue="${project.build.outputDirectory}") String classPath
      Load user classes from classPath.
    • classPaths

      @Parameter(property="javacpp.classPaths") String[] classPaths
      Load user classes from classPaths.
    • includePath

      @Parameter(property="javacpp.includePath") String includePath
      Add the path to the "platform.includepath" property.
    • includePaths

      @Parameter(property="javacpp.includePaths") String[] includePaths
      Add the paths to the "platform.includepath" property.
    • includeResource

      @Parameter(property="javacpp.includeResource") String includeResource
      Add the path to the "platform.includeresource" property.
    • includeResources

      @Parameter(property="javacpp.includeResources") String[] includeResources
      Add the paths to the "platform.includeresource" property.
    • buildPath

      @Parameter(property="javacpp.buildPath") String buildPath
      Add the path to the "platform.buildpath" property.
    • buildPaths

      @Parameter(property="javacpp.buildPaths") String[] buildPaths
      Add the paths to the "platform.buildpath" property.
    • buildResource

      @Parameter(property="javacpp.buildResource") String buildResource
      Add the path to the "platform.buildresource" property.
    • buildResources

      @Parameter(property="javacpp.buildResources") String[] buildResources
      Add the paths to the "platform.buildresource" property.
    • linkPath

      @Parameter(property="javacpp.linkPath") String linkPath
      Add the path to the "platform.linkpath" property.
    • linkPaths

      @Parameter(property="javacpp.linkPaths") String[] linkPaths
      Add the paths to the "platform.linkpath" property.
    • linkResource

      @Parameter(property="javacpp.linkResource") String linkResource
      Add the path to the "platform.linkresource" property.
    • linkResources

      @Parameter(property="javacpp.linkResources") String[] linkResources
      Add the paths to the "platform.linkresource" property.
    • preloadPath

      @Parameter(property="javacpp.preloadPath") String preloadPath
      Add the path to the "platform.preloadpath" property.
    • preloadPaths

      @Parameter(property="javacpp.preloadPaths") String[] preloadPaths
      Add the paths to the "platform.preloadpath" property.
    • preloadResource

      @Parameter(property="javacpp.preloadResource") String preloadResource
      Add the path to the "platform.preloadresource" property.
    • preloadResources

      @Parameter(property="javacpp.preloadResources") String[] preloadResources
      Add the paths to the "platform.preloadresource" property.
    • resourcePath

      @Parameter(property="javacpp.resourcePath") String resourcePath
      Add the path to the "platform.resourcepath" property.
    • resourcePaths

      @Parameter(property="javacpp.resourcePaths") String[] resourcePaths
      Add the paths to the "platform.resourcepath" property.
    • executablePath

      @Parameter(property="javacpp.executablePath") String executablePath
      Add the path to the "platform.executablepath" property.
    • executablePaths

      @Parameter(property="javacpp.executablePaths") String[] executablePaths
      Add the paths to the "platform.executablepath" property.
    • encoding

      @Parameter(property="javacpp.encoding") String encoding
      Specify the character encoding used for input and output.
    • outputDirectory

      @Parameter(property="javacpp.outputDirectory") File outputDirectory
      Output all generated files to outputDirectory.
    • outputName

      @Parameter(property="javacpp.outputName") String outputName
      Output everything in a file named after given outputName.
    • clean

      @Parameter(property="javacpp.clean", defaultValue="false") boolean clean
      Delete all files from outputDirectory before generating anything in it.
    • generate

      @Parameter(property="javacpp.generate", defaultValue="true") boolean generate
      Generate .cpp files from Java interfaces if found, parsing from header files if not.
    • compile

      @Parameter(property="javacpp.compile", defaultValue="true") boolean compile
      Compile and delete the generated .cpp files.
    • deleteJniFiles

      @Parameter(property="javacpp.deleteJniFiles", defaultValue="true") boolean deleteJniFiles
      Delete generated C++ JNI files after compilation
    • copyLibs

      @Parameter(property="javacpp.copyLibs", defaultValue="false") boolean copyLibs
      Copy to output directory dependent libraries (link and preload).
    • copyResources

      @Parameter(property="javacpp.copyResources", defaultValue="false") boolean copyResources
      Copy to output directory resources listed in properties.
    • configDirectory

      @Parameter(property="javacpp.configDirectory") String configDirectory
      Also create config files for GraalVM native-image in directory.
    • jarPrefix

      @Parameter(property="javacpp.jarPrefix") String jarPrefix
      Also create a JAR file named <jarPrefix>-<platform>.jar.
    • properties

      @Parameter(property="javacpp.properties") String properties
      Load all properties from resource.
    • propertyFile

      @Parameter(property="javacpp.propertyFile") File propertyFile
      Load all properties from file.
    • propertyKeysAndValues

      @Parameter(property="javacpp.propertyKeysAndValues") Properties propertyKeysAndValues
      Set property keys to values.
    • classOrPackageName

      @Parameter(property="javacpp.classOrPackageName") String classOrPackageName
      Process only this class or package (suffixed with .* or .**).
    • classOrPackageNames

      @Parameter(property="javacpp.classOrPackageNames") String[] classOrPackageNames
      Process only these classes or packages (suffixed with .* or .**).
    • buildCommand

      @Parameter(property="javacpp.buildCommand") String[] buildCommand
      Execute a build command instead of JavaCPP itself, and return.
    • targetDirectory

      @Parameter(property="javacpp.targetDirectory") String targetDirectory
      Add to Maven project source directory of Java files generated by buildCommand.
    • targetDirectories

      @Parameter(property="javacpp.targetDirectories") String[] targetDirectories
      Add to Maven project source directory of Java files generated by buildCommand.
    • workingDirectory

      @Parameter(property="javacpp.workingDirectory") File workingDirectory
      Set the working directory of the build subprocess.
    • environmentVariables

      @Parameter(property="javacpp.environmentVariables") Map<String,String> environmentVariables
      Add environment variables to the compiler subprocess.
    • compilerOptions

      @Parameter(property="javacpp.compilerOptions") String[] compilerOptions
      Pass compilerOptions directly to compiler.
    • skip

      @Parameter(property="javacpp.skip", defaultValue="false") boolean skip
      Skip the execution.
    • project

      @Parameter(defaultValue="${project}", required=true, readonly=true) org.apache.maven.project.MavenProject project
    • plugin

      @Parameter(defaultValue="${plugin}", required=true, readonly=true) org.apache.maven.plugin.descriptor.PluginDescriptor plugin
  • Constructor Details

    • BuildMojo

      public BuildMojo()
  • Method Details

    • merge

      static String[] merge(String[] ss, String s)
    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException