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.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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterProjectsRead
(org.apache.maven.execution.MavenSession session) void
enableLogging
(org.codehaus.plexus.logging.Logger logger) protected Optional<org.apache.maven.model.PluginExecution>
findMatchingMavenPackagingPluginExecution
(org.apache.maven.model.Plugin mavenPackagingPlugin, String classifier) protected org.apache.maven.model.Plugin
getBndMavenPlugin
(org.apache.maven.model.Model model) Returns the bnd-maven-plugin from build/plugins section of model ornull
if not present.protected org.apache.maven.model.Plugin
getBndMavenPluginFromContainer
(org.apache.maven.model.PluginContainer pluginContainer) Returns the bnd-maven-plugin from pluginContainer ornull
if not present.protected org.apache.maven.model.Plugin
getMavenJarPlugin
(org.apache.maven.model.Model model) Returns the maven-jar-plugin from build/plugins section of model ornull
if not present.protected org.apache.maven.model.Plugin
getMavenJarPluginFromContainer
(org.apache.maven.model.PluginContainer pluginContainer) Returns the maven-jar-plugin from pluginContainer ornull
if not present.protected org.apache.maven.model.Plugin
getMavenWarPlugin
(org.apache.maven.model.Model model) Returns the maven-war-plugin from build/plugins section of model ornull
if not present.protected org.apache.maven.model.Plugin
getMavenWarPluginFromContainer
(org.apache.maven.model.PluginContainer pluginContainer) Returns the maven-war-plugin from pluginContainer ornull
if not present.protected org.apache.maven.model.Plugin
getPluginByGAFromContainer
(String groupId, String artifactId, org.apache.maven.model.PluginContainer pluginContainer) protected String
nullToEmpty
(String str) protected void
processExecutions
(List<org.apache.maven.model.PluginExecution> bndMavenPluginExecutions, org.apache.maven.model.Plugin mavenPackagingPlugin, org.apache.maven.project.MavenProject project) Methods inherited from class org.apache.maven.AbstractMavenLifecycleParticipant
afterSessionEnd, afterSessionStart
-
Field Details
-
THIS_GROUP_ID
- See Also:
-
THIS_ARTIFACT_ID
- See Also:
-
MAVEN_JAR_PLUGIN_GROUP_ID
- See Also:
-
MAVEN_JAR_PLUGIN_ARTIFACT_ID
- See Also:
-
MAVEN_WAR_PLUGIN_GROUP_ID
- See Also:
-
MAVEN_WAR_PLUGIN_ARTIFACT_ID
- See Also:
-
logger
private org.codehaus.plexus.logging.Logger logger
-
-
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 classorg.apache.maven.AbstractMavenLifecycleParticipant
- Throws:
org.apache.maven.MavenExecutionException
-
enableLogging
public void enableLogging(org.codehaus.plexus.logging.Logger logger) - Specified by:
enableLogging
in interfaceorg.codehaus.plexus.logging.LogEnabled
-
findMatchingMavenPackagingPluginExecution
-
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 ornull
if not present. -
getBndMavenPluginFromContainer
protected org.apache.maven.model.Plugin getBndMavenPluginFromContainer(org.apache.maven.model.PluginContainer pluginContainer) Returns the bnd-maven-plugin from pluginContainer ornull
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 ornull
if not present. -
getMavenJarPluginFromContainer
protected org.apache.maven.model.Plugin getMavenJarPluginFromContainer(org.apache.maven.model.PluginContainer pluginContainer) Returns the maven-jar-plugin from pluginContainer ornull
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 ornull
if not present. -
getMavenWarPluginFromContainer
protected org.apache.maven.model.Plugin getMavenWarPluginFromContainer(org.apache.maven.model.PluginContainer pluginContainer) Returns the maven-war-plugin from pluginContainer ornull
if not present. -
getPluginByGAFromContainer
-
nullToEmpty
-
processExecutions
protected void processExecutions(List<org.apache.maven.model.PluginExecution> bndMavenPluginExecutions, org.apache.maven.model.Plugin mavenPackagingPlugin, org.apache.maven.project.MavenProject project)
-