Class BndMavenPlugin

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

    @Mojo(name="bnd-process",
          defaultPhase=PROCESS_CLASSES,
          requiresDependencyResolution=COMPILE)
    public class BndMavenPlugin
    extends org.apache.maven.plugin.AbstractMojo
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String bnd
      Bnd instructions for this project specified directly in the pom file.
      private java.lang.String bndfile
      File path to a bnd file containing bnd instructions for this project.
      private org.sonatype.plexus.build.incremental.BuildContext buildContext  
      private java.io.File classesDir  
      private static org.slf4j.Logger logger  
      private static java.lang.String MANIFEST_LAST_MODIFIED  
      private java.io.File manifestPath  
      private static java.lang.String MARKED_FILES  
      private org.apache.maven.plugin.MojoExecution mojoExecution  
      private static java.lang.String PACKAGING_POM  
      private org.apache.maven.project.MavenProject project  
      private java.io.File propertiesFile  
      private java.util.List<org.apache.maven.model.Resource> resources  
      private org.apache.maven.settings.Settings settings  
      private boolean skip  
      private java.io.File sourceDir  
      private java.io.File targetDir  
      private static java.lang.String TSTAMP  
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Constructor Summary

      Constructors 
      Constructor Description
      BndMavenPlugin()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute()  
      private void expandJar​(Jar jar, java.io.File dir)  
      private java.io.File loadProjectProperties​(Builder builder, org.apache.maven.project.MavenProject project)  
      private boolean manifestOutOfDate()  
      private void reportErrorsAndWarnings​(Builder builder)  
      • 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

      • logger

        private static final org.slf4j.Logger logger
      • MANIFEST_LAST_MODIFIED

        private static final java.lang.String MANIFEST_LAST_MODIFIED
        See Also:
        Constant Field Values
      • targetDir

        @Parameter(defaultValue="${project.build.directory}",
                   readonly=true)
        private java.io.File targetDir
      • sourceDir

        @Parameter(defaultValue="${project.build.sourceDirectory}",
                   readonly=true)
        private java.io.File sourceDir
      • resources

        @Parameter(defaultValue="${project.build.resources}",
                   readonly=true)
        private java.util.List<org.apache.maven.model.Resource> resources
      • classesDir

        @Parameter(defaultValue="${project.build.outputDirectory}",
                   readonly=true)
        private java.io.File classesDir
      • manifestPath

        @Parameter(defaultValue="${project.build.outputDirectory}/META-INF/MANIFEST.MF",
                   readonly=true)
        private java.io.File manifestPath
      • project

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

        @Parameter(defaultValue="${settings}",
                   readonly=true)
        private org.apache.maven.settings.Settings settings
      • mojoExecution

        @Parameter(defaultValue="${mojoExecution}",
                   readonly=true)
        private org.apache.maven.plugin.MojoExecution mojoExecution
      • skip

        @Parameter(property="bnd.skip",
                   defaultValue="false")
        private boolean skip
      • bndfile

        @Parameter(defaultValue="bnd.bnd")
        private java.lang.String bndfile
        File path to a bnd file containing bnd instructions for this project. Defaults to bnd.bnd. The file path can be an absolute or relative to the project directory.

        The bnd instructions for this project are merged with the bnd instructions, if any, for the parent project.

      • bnd

        @Parameter
        private java.lang.String bnd
        Bnd instructions for this project specified directly in the pom file. This is generally be done using a <![CDATA[]]> section. If the projects has a bnd file, then this configuration element is ignored.

        The bnd instructions for this project are merged with the bnd instructions, if any, for the parent project.

      • buildContext

        @Component
        private org.sonatype.plexus.build.incremental.BuildContext buildContext
      • propertiesFile

        private java.io.File propertiesFile
    • Constructor Detail

      • BndMavenPlugin

        public BndMavenPlugin()
    • Method Detail

      • execute

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

        private java.io.File loadProjectProperties​(Builder builder,
                                                   org.apache.maven.project.MavenProject project)
                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • reportErrorsAndWarnings

        private void reportErrorsAndWarnings​(Builder builder)
                                      throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • expandJar

        private void expandJar​(Jar jar,
                               java.io.File dir)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • manifestOutOfDate

        private boolean manifestOutOfDate()