Class NativeLinkMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    public class NativeLinkMojo
    extends AbstractNativeMojo
    Link all previously built object and dependent library files into final build artifact
    • Field Detail

      • compilerProvider

        private java.lang.String compilerProvider
        Override this property if permitted by compilerProvider
        Since:
        1.0-alpha-2
      • linkerProvider

        private java.lang.String linkerProvider
        Default value is ${compilerProvider}
        Since:
        1.0-alpha-2
      • linkerExecutable

        private java.lang.String linkerExecutable
        Override this property if permitted by linkerProvider. Default to compilerType if not provided
        Since:
        1.0-alpha-2
      • linkerStartOptions

        private java.util.List linkerStartOptions
        Additional linker command options
        Since:
        1.0-alpha-2
      • linkerMiddleOptions

        private java.util.List linkerMiddleOptions
        Additional linker command options
        Since:
        1.0-alpha-2
      • linkerEndOptions

        private java.util.List linkerEndOptions
        Additional linker command options
        Since:
        1.0-alpha-2
      • linkingOrderLibs

        private java.util.List linkingOrderLibs
        Option to reorder dependency list, each item has the format of ${groupId}:${artifactId}
        Since:
        1.0-alpha-2
      • linkerSecondaryOutputExtensions

        private java.lang.String linkerSecondaryOutputExtensions
        Comma separated extension type to be installed/deployed. Use this option to deploy library file produced by dll build on windows
        Since:
        1.0-alpha-2
      • linkerOutputDirectory

        protected java.io.File linkerOutputDirectory
        Where to place the final packaging
        Since:
        1.0-alpha-2
      • linkerFinalName

        private java.lang.String linkerFinalName
        The name of the generated file
        Since:
        1.0-alpha-8
      • manager

        private LinkerManager manager
        Internal
        Since:
        1.0-alpha-2
      • artifactFactory

        private org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
        Internal
        Since:
        1.0-alpha-2
      • externalLibDirectory

        private java.io.File externalLibDirectory
        Dependent libraries with version + classifier removed are copied to this directory to be linked to the build artifact
      • classifier

        private java.lang.String classifier
        Option to install primary artifact as a classifier, useful to install/deploy debug artifacts
        Since:
        1.0-alpha-2
      • attach

        private boolean attach
        Attach the linker's outputs to maven project be installed/deployed. Turn this off if you have other mean of deployment, for example using maven-assembly-plugin to deploy your own bundle
        Since:
        1.0-alpha-2
      • usingLinkerResponseFile

        private boolean usingLinkerResponseFile
        For project with lots of object files on windows, turn this flag to resolve Windows commandline length limit
        Since:
        1.0-alpha-7
      • checkStaleLinkage

        private boolean checkStaleLinkage
        Enable this option to speed up linkage for large project with no dependencies changes
        Since:
        1.0-alpha-8
    • Constructor Detail

      • NativeLinkMojo

        public NativeLinkMojo()
    • Method Detail

      • execute

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

        private LinkerConfiguration createLinkerConfiguration()
                                                       throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getLinker

        private Linker getLinker()
                          throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • attachPrimaryArtifact

        private void attachPrimaryArtifact()
      • attachSecondaryArtifacts

        private void attachSecondaryArtifacts()
      • getLibFileNames

        private java.util.List getLibFileNames()
                                        throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getDependenciesFileOrderList

        private java.util.List getDependenciesFileOrderList()
                                                     throws org.apache.maven.plugin.MojoExecutionException
        convert dependencyLinkingOrders to a file list
        Returns:
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • lookupDependencyUsingGroupArtifactIdPair

        private org.apache.maven.artifact.Artifact lookupDependencyUsingGroupArtifactIdPair​(java.lang.String groupArtifactIdPair)
                                                                                     throws org.apache.maven.plugin.MojoExecutionException
        Look up library in dependency list using groupId:artifactId key Note: we can not use project.artifactMap due the introduction of inczip dependency where 2 dependency with the same artifactId and groupId, but differs by extension type make the map not suitable for lookup
        Parameters:
        groupArtifactIdPair -
        Returns:
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • reorderLibDependencies

        private java.util.List reorderLibDependencies​(java.util.List libs)
                                               throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getDependencyFile

        private java.io.File getDependencyFile​(org.apache.maven.artifact.Artifact artifact,
                                               boolean doCopy)
                                        throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException