Class ManifestPlugin

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
    Direct Known Subclasses:
    BundleAllPlugin

    @Mojo(name="manifest",
          requiresDependencyResolution=TEST,
          threadSafe=true,
          defaultPhase=PROCESS_CLASSES)
    public class ManifestPlugin
    extends BundlePlugin
    Generate an OSGi manifest for this project
    • Field Detail

      • rebuildBundle

        @Parameter(property="rebuildBundle")
        protected boolean rebuildBundle
        When true, generate the manifest by rebuilding the full bundle in memory
    • Constructor Detail

      • ManifestPlugin

        public ManifestPlugin()
    • Method Detail

      • execute

        protected void execute​(org.apache.maven.project.MavenProject project,
                               org.apache.maven.shared.dependency.graph.DependencyNode dependencyGraph,
                               Map<String,​String> instructions,
                               Properties properties,
                               aQute.bnd.osgi.Jar[] classpath)
                        throws org.apache.maven.plugin.MojoExecutionException
        Overrides:
        execute in class BundlePlugin
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getManifest

        public Manifest getManifest​(org.apache.maven.project.MavenProject project,
                                    org.apache.maven.shared.dependency.graph.DependencyNode dependencyGraph,
                                    aQute.bnd.osgi.Jar[] classpath)
                             throws IOException,
                                    org.apache.maven.plugin.MojoFailureException,
                                    org.apache.maven.plugin.MojoExecutionException,
                                    Exception
        Throws:
        IOException
        org.apache.maven.plugin.MojoFailureException
        org.apache.maven.plugin.MojoExecutionException
        Exception
      • getManifest

        public Manifest getManifest​(org.apache.maven.project.MavenProject project,
                                    org.apache.maven.shared.dependency.graph.DependencyNode dependencyGraph,
                                    Map<String,​String> instructions,
                                    Properties properties,
                                    aQute.bnd.osgi.Jar[] classpath,
                                    org.sonatype.plexus.build.incremental.BuildContext buildContext)
                             throws IOException,
                                    org.apache.maven.plugin.MojoFailureException,
                                    org.apache.maven.plugin.MojoExecutionException,
                                    Exception
        Throws:
        IOException
        org.apache.maven.plugin.MojoFailureException
        org.apache.maven.plugin.MojoExecutionException
        Exception
      • getAnalyzer

        protected aQute.bnd.osgi.Analyzer getAnalyzer​(org.apache.maven.project.MavenProject project,
                                                      org.apache.maven.shared.dependency.graph.DependencyNode dependencyGraph,
                                                      aQute.bnd.osgi.Jar[] classpath)
                                               throws IOException,
                                                      org.apache.maven.plugin.MojoExecutionException,
                                                      Exception
        Throws:
        IOException
        org.apache.maven.plugin.MojoExecutionException
        Exception
      • getAnalyzer

        protected aQute.bnd.osgi.Analyzer getAnalyzer​(org.apache.maven.project.MavenProject project,
                                                      org.apache.maven.shared.dependency.graph.DependencyNode dependencyGraph,
                                                      Map<String,​String> instructions,
                                                      Properties properties,
                                                      aQute.bnd.osgi.Jar[] classpath)
                                               throws IOException,
                                                      org.apache.maven.plugin.MojoExecutionException,
                                                      Exception
        Throws:
        IOException
        org.apache.maven.plugin.MojoExecutionException
        Exception
      • writeManifest

        public static void writeManifest​(aQute.bnd.osgi.Analyzer analyzer,
                                         File outputFile,
                                         boolean niceManifest,
                                         boolean exportScr,
                                         File scrLocation,
                                         org.sonatype.plexus.build.incremental.BuildContext buildContext,
                                         org.apache.maven.plugin.logging.Log log)
                                  throws Exception
        Throws:
        Exception
      • writeManifest

        public static void writeManifest​(Manifest manifest,
                                         File outputFile,
                                         boolean niceManifest,
                                         org.sonatype.plexus.build.incremental.BuildContext buildContext,
                                         org.apache.maven.plugin.logging.Log log)
                                  throws IOException
        Throws:
        IOException
      • calculateExportsFromContents

        public static String calculateExportsFromContents​(aQute.bnd.osgi.Jar bundle)