Package aQute.bnd.maven.plugin
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.LogEnabledThis lifecycle participant is meant to simplify the changes required to the configuration of the maven packaging plugins when thebnd-maven-pluginis used. It will silently "scan" projects, and disable themaven-jar-pluginor themaven-war-pluginappropriately.Lifecycle participants are only active when the host plugin (
bnd-maven-pluginin this case) has:<extensions>true</extensions>
This acts as the opt-in. Without it the
bnd-maven-plugin,maven-jar-pluginandmaven-war-pluginbehave in the traditional fashion.
-
-
Field Summary
Fields Modifier and Type Field Description private org.codehaus.plexus.logging.Loggerloggerstatic java.lang.StringMAVEN_JAR_PLUGIN_ARTIFACT_IDstatic java.lang.StringMAVEN_JAR_PLUGIN_GROUP_IDstatic java.lang.StringMAVEN_WAR_PLUGIN_ARTIFACT_IDstatic java.lang.StringMAVEN_WAR_PLUGIN_GROUP_IDstatic java.lang.StringTHIS_ARTIFACT_IDstatic java.lang.StringTHIS_GROUP_ID
-
Constructor Summary
Constructors Constructor Description BndPackagingLifecycleParticipant()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterProjectsRead(org.apache.maven.execution.MavenSession session)voidenableLogging(org.codehaus.plexus.logging.Logger logger)protected java.util.Optional<org.apache.maven.model.PluginExecution>findMatchingMavenPackagingPluginExecution(java.util.List<org.apache.maven.model.PluginExecution> mavenPackagingPluginExecutions, java.lang.String classifier)protected org.apache.maven.model.PlugingetBndMavenPlugin(org.apache.maven.model.Model model)Returns the bnd-maven-plugin from build/plugins section of model ornullif not present.protected org.apache.maven.model.PlugingetBndMavenPluginFromContainer(org.apache.maven.model.PluginContainer pluginContainer)Returns the bnd-maven-plugin from pluginContainer ornullif not present.protected org.apache.maven.model.PlugingetMavenJarPlugin(org.apache.maven.model.Model model)Returns the maven-jar-plugin from build/plugins section of model ornullif not present.protected org.apache.maven.model.PlugingetMavenJarPluginFromContainer(org.apache.maven.model.PluginContainer pluginContainer)Returns the maven-jar-plugin from pluginContainer ornullif not present.protected org.apache.maven.model.PlugingetMavenWarPlugin(org.apache.maven.model.Model model)Returns the maven-war-plugin from build/plugins section of model ornullif not present.protected org.apache.maven.model.PlugingetMavenWarPluginFromContainer(org.apache.maven.model.PluginContainer pluginContainer)Returns the maven-war-plugin from pluginContainer ornullif not present.protected org.apache.maven.model.PlugingetPluginByGAFromContainer(java.lang.String groupId, java.lang.String artifactId, org.apache.maven.model.PluginContainer pluginContainer)protected java.lang.StringnullToEmpty(java.lang.String str)protected voidprocessExecutions(java.util.List<org.apache.maven.model.PluginExecution> bndMavenPluginExecutions, org.apache.maven.model.Plugin mavenPackagingPlugin, org.apache.maven.project.MavenProject project)
-
-
-
Field Detail
-
THIS_GROUP_ID
public static final java.lang.String THIS_GROUP_ID
- See Also:
- Constant Field Values
-
THIS_ARTIFACT_ID
public static final java.lang.String THIS_ARTIFACT_ID
- See Also:
- Constant Field Values
-
MAVEN_JAR_PLUGIN_GROUP_ID
public static final java.lang.String MAVEN_JAR_PLUGIN_GROUP_ID
- See Also:
- Constant Field Values
-
MAVEN_JAR_PLUGIN_ARTIFACT_ID
public static final java.lang.String MAVEN_JAR_PLUGIN_ARTIFACT_ID
- See Also:
- Constant Field Values
-
MAVEN_WAR_PLUGIN_GROUP_ID
public static final java.lang.String MAVEN_WAR_PLUGIN_GROUP_ID
- See Also:
- Constant Field Values
-
MAVEN_WAR_PLUGIN_ARTIFACT_ID
public static final java.lang.String MAVEN_WAR_PLUGIN_ARTIFACT_ID
- See Also:
- Constant Field Values
-
logger
private org.codehaus.plexus.logging.Logger logger
-
-
Method Detail
-
afterProjectsRead
public void afterProjectsRead(org.apache.maven.execution.MavenSession session) throws org.apache.maven.MavenExecutionException- Overrides:
afterProjectsReadin classorg.apache.maven.AbstractMavenLifecycleParticipant- Throws:
org.apache.maven.MavenExecutionException
-
enableLogging
public void enableLogging(org.codehaus.plexus.logging.Logger logger)
- Specified by:
enableLoggingin interfaceorg.codehaus.plexus.logging.LogEnabled
-
findMatchingMavenPackagingPluginExecution
protected java.util.Optional<org.apache.maven.model.PluginExecution> findMatchingMavenPackagingPluginExecution(java.util.List<org.apache.maven.model.PluginExecution> mavenPackagingPluginExecutions, java.lang.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 ornullif not present.
-
getBndMavenPluginFromContainer
protected org.apache.maven.model.Plugin getBndMavenPluginFromContainer(org.apache.maven.model.PluginContainer pluginContainer)
Returns the bnd-maven-plugin from pluginContainer ornullif 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 ornullif not present.
-
getMavenJarPluginFromContainer
protected org.apache.maven.model.Plugin getMavenJarPluginFromContainer(org.apache.maven.model.PluginContainer pluginContainer)
Returns the maven-jar-plugin from pluginContainer ornullif 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 ornullif not present.
-
getMavenWarPluginFromContainer
protected org.apache.maven.model.Plugin getMavenWarPluginFromContainer(org.apache.maven.model.PluginContainer pluginContainer)
Returns the maven-war-plugin from pluginContainer ornullif not present.
-
getPluginByGAFromContainer
protected org.apache.maven.model.Plugin getPluginByGAFromContainer(java.lang.String groupId, java.lang.String artifactId, org.apache.maven.model.PluginContainer pluginContainer)
-
nullToEmpty
protected java.lang.String nullToEmpty(java.lang.String str)
-
processExecutions
protected void processExecutions(java.util.List<org.apache.maven.model.PluginExecution> bndMavenPluginExecutions, org.apache.maven.model.Plugin mavenPackagingPlugin, org.apache.maven.project.MavenProject project)
-
-