Class BndPackagingLifecycleParticipant

java.lang.Object
org.apache.maven.AbstractMavenLifecycleParticipant
aQute.bnd.maven.plugin.BndPackagingLifecycleParticipant
All Implemented Interfaces:
org.codehaus.plexus.logging.LogEnabled

@Component(role=org.apache.maven.AbstractMavenLifecycleParticipant.class, hint="aQute.bnd.maven.plugin.BndPackagingLifecycleParticipant") public class BndPackagingLifecycleParticipant extends org.apache.maven.AbstractMavenLifecycleParticipant implements org.codehaus.plexus.logging.LogEnabled
This lifecycle participant is meant to simplify the changes required to the configuration of the maven packaging plugins when the bnd-maven-plugin is used. It will silently "scan" projects, and disable the maven-jar-plugin or the maven-war-plugin appropriately.

Lifecycle participants are only active when the host plugin (bnd-maven-plugin in this case) has:

<extensions>true</extensions>

This acts as the opt-in. Without it the bnd-maven-plugin, maven-jar-plugin and maven-war-plugin behave in the traditional fashion.

  • Field Details

  • Constructor Details

    • BndPackagingLifecycleParticipant

      public BndPackagingLifecycleParticipant()
  • Method Details

    • afterProjectsRead

      public void afterProjectsRead(org.apache.maven.execution.MavenSession session) throws org.apache.maven.MavenExecutionException
      Overrides:
      afterProjectsRead in class org.apache.maven.AbstractMavenLifecycleParticipant
      Throws:
      org.apache.maven.MavenExecutionException
    • enableLogging

      public void enableLogging(org.codehaus.plexus.logging.Logger logger)
      Specified by:
      enableLogging in interface org.codehaus.plexus.logging.LogEnabled
    • findMatchingMavenPackagingPluginExecution

      protected Optional<org.apache.maven.model.PluginExecution> findMatchingMavenPackagingPluginExecution(org.apache.maven.model.Plugin mavenPackagingPlugin, String classifier)
    • getBndMavenPlugin

      protected org.apache.maven.model.Plugin getBndMavenPlugin(org.apache.maven.model.Model model)
      Returns the bnd-maven-plugin from build/plugins section of model or null if not present.
    • getBndMavenPluginFromContainer

      protected org.apache.maven.model.Plugin getBndMavenPluginFromContainer(org.apache.maven.model.PluginContainer pluginContainer)
      Returns the bnd-maven-plugin from pluginContainer or null if not present.
    • getMavenJarPlugin

      protected org.apache.maven.model.Plugin getMavenJarPlugin(org.apache.maven.model.Model model)
      Returns the maven-jar-plugin from build/plugins section of model or null if not present.
    • getMavenJarPluginFromContainer

      protected org.apache.maven.model.Plugin getMavenJarPluginFromContainer(org.apache.maven.model.PluginContainer pluginContainer)
      Returns the maven-jar-plugin from pluginContainer or null if not present.
    • getMavenWarPlugin

      protected org.apache.maven.model.Plugin getMavenWarPlugin(org.apache.maven.model.Model model)
      Returns the maven-war-plugin from build/plugins section of model or null if not present.
    • getMavenWarPluginFromContainer

      protected org.apache.maven.model.Plugin getMavenWarPluginFromContainer(org.apache.maven.model.PluginContainer pluginContainer)
      Returns the maven-war-plugin from pluginContainer or null if not present.
    • getPluginByGAFromContainer

      protected org.apache.maven.model.Plugin getPluginByGAFromContainer(String groupId, String artifactId, org.apache.maven.model.PluginContainer pluginContainer)
    • nullToEmpty

      protected String nullToEmpty(String str)
    • processExecutions

      protected void processExecutions(List<org.apache.maven.model.PluginExecution> bndMavenPluginExecutions, org.apache.maven.model.Plugin mavenPackagingPlugin, org.apache.maven.project.MavenProject project)