Class PearPackagingMojo

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

    @Mojo(name="package",
          defaultPhase=PACKAGE)
    public class PearPackagingMojo
    extends org.apache.maven.plugin.AbstractMojo
    PearPackagingMojo which generates an UIMA PEAR package. All the necessary information from the UIMA nature is gathered and added to the PEAR package. Additionally the generated jar file from the Maven build is added with the according classpath information.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String classpath
      Required classpath settings for the PEAR package.
      private java.util.Set<java.lang.String> classpathsDefined  
      private java.util.ArrayList<java.lang.String> classpathsInOrder  
      private java.lang.String componentId
      PEAR package component ID
      private java.lang.String datapath
      Required UIMA datapath settings for the PEAR package
      private org.apache.maven.plugin.logging.Log log  
      private java.lang.String mainComponentDesc
      Main Component Descriptor path relative to the main component directory
      private java.lang.String mainComponentDir
      Main component directory of the UIMA project that contains the UIMA nature.
      private java.io.File pearPackagingDir  
      private org.apache.maven.project.MavenProject project
      The maven project.
      private java.util.Properties props
      Required environment variables for the PEAR package
      private java.lang.String targetDir
      Target directory for the PEAR package
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void copyDirIfAvailable​(java.lang.String directory)
      Copies the given directory when available to the PEAR packaging directory
      private void copyPearData()
      Copies all the necessary PEAR directories (UIMA nature) to the PEAR packaging directory
      private void createPear()
      create a PEAR package with
      void execute()  
      private Level getCurrentUIMALogLevel()
      Returns the current UIMA log level for the UIMA root logger
      private void maybeAddClasspath​(java.lang.String acp)  
      private void removeDotDirectories​(java.io.File dir)
      Removes recursively all directories that begins with a "." e.g.
      • 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 Detail

      • mainComponentDir

        @Parameter(defaultValue="${basedir}",
                   property="basedir",
                   required=true)
        private java.lang.String mainComponentDir
        Main component directory of the UIMA project that contains the UIMA nature.
      • classpath

        @Parameter(defaultValue="${pear.classpath}",
                   property="pear.classpath")
        private java.lang.String classpath
        Required classpath settings for the PEAR package.
      • mainComponentDesc

        @Parameter(defaultValue="${pear.mainComponentDesc}",
                   property="pear.mainComponentDesc",
                   required=true)
        private java.lang.String mainComponentDesc
        Main Component Descriptor path relative to the main component directory
      • componentId

        @Parameter(defaultValue="${pear.componentId}",
                   property="pear.componentId",
                   required=true)
        private java.lang.String componentId
        PEAR package component ID
      • targetDir

        @Parameter(defaultValue="${basedir}/target",
                   required=true)
        private java.lang.String targetDir
        Target directory for the PEAR package
      • datapath

        @Parameter(defaultValue="$main_root/resources")
        private java.lang.String datapath
        Required UIMA datapath settings for the PEAR package
      • props

        @Parameter
        private java.util.Properties props
        Required environment variables for the PEAR package
      • project

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

        private java.io.File pearPackagingDir
      • classpathsInOrder

        private java.util.ArrayList<java.lang.String> classpathsInOrder
      • classpathsDefined

        private java.util.Set<java.lang.String> classpathsDefined
      • log

        private org.apache.maven.plugin.logging.Log log
    • Constructor Detail

      • PearPackagingMojo

        public PearPackagingMojo()
    • Method Detail

      • execute

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

        private void maybeAddClasspath​(java.lang.String acp)
      • getCurrentUIMALogLevel

        private Level getCurrentUIMALogLevel()
        Returns the current UIMA log level for the UIMA root logger
        Returns:
        the current UIMA log level
      • copyDirIfAvailable

        private void copyDirIfAvailable​(java.lang.String directory)
                                 throws java.io.IOException
        Copies the given directory when available to the PEAR packaging directory
        Parameters:
        directory - directory to copy
        Throws:
        java.io.IOException - passthru
      • removeDotDirectories

        private void removeDotDirectories​(java.io.File dir)
                                   throws java.io.IOException
        Removes recursively all directories that begins with a "." e.g. ".SVN"
        Parameters:
        dir - directory to check for Dot-directories
        Throws:
        java.io.IOException - passthru
      • copyPearData

        private void copyPearData()
                           throws java.io.IOException
        Copies all the necessary PEAR directories (UIMA nature) to the PEAR packaging directory
        Throws:
        java.io.IOException - passthru