Class AbstractBndMavenPlugin

java.lang.Object
org.apache.maven.plugin.AbstractMojo
aQute.bnd.maven.plugin.AbstractBndMavenPlugin
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
BndMavenPlugin, BndMavenTestsPlugin

public abstract class AbstractBndMavenPlugin extends org.apache.maven.plugin.AbstractMojo
  • Field Details

    • logger

      protected final org.slf4j.Logger logger
    • MANIFEST_LAST_MODIFIED

      static final String MANIFEST_LAST_MODIFIED
      See Also:
    • MARKED_FILES

      static final String MARKED_FILES
      See Also:
    • PACKAGING_JAR

      static final String PACKAGING_JAR
      See Also:
    • PACKAGING_WAR

      static final String PACKAGING_WAR
      See Also:
    • TSTAMP

      static final String TSTAMP
      See Also:
    • SNAPSHOT

      static final String SNAPSHOT
      See Also:
    • targetDir

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

      @Parameter(defaultValue="true") boolean includeClassesDir
    • warOutputDir

      @Parameter(defaultValue="${project.build.directory}/${project.build.finalName}") File warOutputDir
    • project

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

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

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

      @Parameter(property="bnd.packagingTypes", defaultValue="jar,war") List<String> packagingTypes
    • skipIfEmpty

      @Parameter(property="bnd.skipIfEmpty", defaultValue="false") boolean skipIfEmpty
    • outputTimestamp

      @Parameter(defaultValue="${project.build.outputTimestamp}") private String outputTimestamp
    • bndfile

      @Parameter(defaultValue="bnd.bnd") 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 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 org.sonatype.plexus.build.incremental.BuildContext buildContext
    • projectHelper

      @Component org.apache.maven.project.MavenProjectHelper projectHelper
    • propertiesFile

      File propertiesFile
  • Constructor Details

    • AbstractBndMavenPlugin

      public AbstractBndMavenPlugin()
  • Method Details

    • getSourceDir

      public abstract File getSourceDir()
    • getResources

      public abstract List<org.apache.maven.model.Resource> getResources()
    • getClassesDir

      public abstract File getClassesDir()
    • getOutputDir

      public abstract File getOutputDir()
    • getManifestPath

      public abstract File getManifestPath()
    • isSkip

      public abstract boolean isSkip()
    • getClassifier

      public Optional<String> getClassifier()
    • getType

      public Optional<String> getType()
    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • processBuilder

      protected void processBuilder(Builder builder) throws org.apache.maven.plugin.MojoFailureException
      If a mojo needs to tweak the builder for any particular reason, do it here.
      Parameters:
      builder - the Builder created to analyze the jar contents
      Throws:
      org.apache.maven.plugin.MojoFailureException - if an issue is encountered
    • processBuildPath

      protected void processBuildPath(List<Object> buildpath)
      If a mojo needs to update the buildpath for any particular reason, do it here.
      Parameters:
      buildpath - the set of jars and class directories used while analyzing the jar contents
    • addHeaderValue

      private static StringBuilder addHeaderValue(StringBuilder builder, String value, char separator)
    • addHeaderAttribute

      private static StringBuilder addHeaderAttribute(StringBuilder builder, String key, String value, char separator)
    • attachArtifactToProject

      private void attachArtifactToProject(Jar bndJar) throws Exception
      Throws:
      Exception
    • addMavenMetadataToJar

      private void addMavenMetadataToJar(Jar bndJar) throws IOException
      Throws:
      IOException
    • createArtifactFile

      private File createArtifactFile()
    • createArtifactName

      private String createArtifactName(org.apache.maven.artifact.Artifact artifact)
    • loadProperties

      private File loadProperties(Builder builder) throws Exception
      Throws:
      Exception
    • loadParentProjectProperties

      private void loadParentProjectProperties(Builder builder, org.apache.maven.project.MavenProject currentProject) throws Exception
      Throws:
      Exception
    • loadProjectProperties

      private File loadProjectProperties(Builder builder, org.apache.maven.project.MavenProject bndProject, org.apache.maven.project.MavenProject pomProject, org.codehaus.plexus.util.xml.Xpp3Dom configuration) throws Exception
      Throws:
      Exception
    • getConfiguration

      private Optional<org.codehaus.plexus.util.xml.Xpp3Dom> getConfiguration(List<org.apache.maven.model.Plugin> plugins)
    • defaultConfiguration

      private org.codehaus.plexus.util.xml.Xpp3Dom defaultConfiguration()
    • reportErrorsAndWarnings

      protected void reportErrorsAndWarnings(Builder builder) throws org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoFailureException
    • isEmpty

      protected boolean isEmpty(File directory)
    • expandJar

      private void expandJar(Jar jar, File dir) throws Exception
      Throws:
      Exception
    • manifestOutOfDate

      private boolean manifestOutOfDate()