org.apache.sling.maven.projectsupport
Class AbstractBundleListMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.sling.maven.projectsupport.AbstractBundleListMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
AbstractLaunchpadFrameworkMojo, AbstractLaunchpadStartingMojo, AttachBundleListMojo, CheckBundleListForSnapshotsMojo, CreateKarafFeatureDescriptorMojo, OutputBundleListMojo

public abstract class AbstractBundleListMojo
extends org.apache.maven.plugin.AbstractMojo


Field Summary
protected static String BUNDLE_PATH_PREFIX
           
protected  File bundleListFile
           
protected static String CONFIG_PATH_PREFIX
           
protected  File configDirectory
           
protected  ArtifactDefinition defaultBundleList
          The definition of the defaultBundleList artifact.
protected static String JAR
          JAR Packaging type.
protected  org.apache.maven.execution.MavenSession mavenSession
           
protected  org.apache.maven.project.MavenProject project
          The Maven project.
protected  org.apache.maven.project.MavenProjectHelper projectHelper
           
protected static String WAR
          WAR Packaging type.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractBundleListMojo()
           
 
Method Summary
 void execute()
           
protected abstract  void executeWithArtifacts()
          Execute the logic of the plugin after the default artifacts have been initialized.
protected  org.apache.maven.artifact.Artifact getArtifact(ArtifactDefinition def)
          Get a resolved Artifact from the coordinates found in the artifact definition.
protected  org.apache.maven.artifact.Artifact getArtifact(String groupId, String artifactId, String version, String type, String classifier)
          Get a resolved Artifact from the coordinates provided
protected  BundleList getBundleList()
           
protected  void initArtifactDefinitions(Properties dependencies)
          Hook methods for subclasses to initialize any additional artifact definitions.
protected  void initBundleList(BundleList bundleList)
          Hook methods for subclasses to initialize the bundle list.
protected  boolean isCurrentArtifact(ArtifactDefinition def)
           
protected static boolean shouldCopy(File source, File dest)
           
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configDirectory

protected File configDirectory

JAR

protected static final String JAR
JAR Packaging type.

See Also:
Constant Field Values

WAR

protected static final String WAR
WAR Packaging type.

See Also:
Constant Field Values

CONFIG_PATH_PREFIX

protected static final String CONFIG_PATH_PREFIX
See Also:
Constant Field Values

BUNDLE_PATH_PREFIX

protected static final String BUNDLE_PATH_PREFIX
See Also:
Constant Field Values

bundleListFile

protected File bundleListFile

defaultBundleList

protected ArtifactDefinition defaultBundleList
The definition of the defaultBundleList artifact.


project

protected org.apache.maven.project.MavenProject project
The Maven project.


projectHelper

protected org.apache.maven.project.MavenProjectHelper projectHelper

mavenSession

protected org.apache.maven.execution.MavenSession mavenSession
Constructor Detail

AbstractBundleListMojo

public AbstractBundleListMojo()
Method Detail

shouldCopy

protected static boolean shouldCopy(File source,
                                    File dest)

execute

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

executeWithArtifacts

protected abstract void executeWithArtifacts()
                                      throws org.apache.maven.plugin.MojoExecutionException,
                                             org.apache.maven.plugin.MojoFailureException
Execute the logic of the plugin after the default artifacts have been initialized.

Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

getArtifact

protected org.apache.maven.artifact.Artifact getArtifact(ArtifactDefinition def)
                                                  throws org.apache.maven.plugin.MojoExecutionException
Get a resolved Artifact from the coordinates found in the artifact definition.

Parameters:
def - the artifact definition
Returns:
the artifact, which has been resolved
Throws:
org.apache.maven.plugin.MojoExecutionException

getArtifact

protected org.apache.maven.artifact.Artifact getArtifact(String groupId,
                                                         String artifactId,
                                                         String version,
                                                         String type,
                                                         String classifier)
                                                  throws org.apache.maven.plugin.MojoExecutionException
Get a resolved Artifact from the coordinates provided

Returns:
the artifact, which has been resolved.
Throws:
org.apache.maven.plugin.MojoExecutionException

getBundleList

protected BundleList getBundleList()

initArtifactDefinitions

protected void initArtifactDefinitions(Properties dependencies)
Hook methods for subclasses to initialize any additional artifact definitions.

Parameters:
dependencies - the dependency properties loaded from the JAR file

initBundleList

protected void initBundleList(BundleList bundleList)
Hook methods for subclasses to initialize the bundle list.


isCurrentArtifact

protected boolean isCurrentArtifact(ArtifactDefinition def)


Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.