org.apache.geronimo.mavenplugins.car
Class AbstractCarMojo

java.lang.Object
  extended by org.codehaus.plexus.logging.AbstractLogEnabled
      extended by org.apache.geronimo.mavenplugins.car.AbstractCarMojo
All Implemented Interfaces:
org.apache.maven.plugin.Mojo, org.codehaus.plexus.logging.LogEnabled
Direct Known Subclasses:
ArchiveCarMojo, ArchiveMojo, CreatePluginListMojo, DependencyChangeMojo, InstallModulesMojo, PackageMojo, PlanProcessorMojo, PluginMetadataGeneratorMojo, UpdatePluginListMojo, ValidateConfigurationMojo

public abstract class AbstractCarMojo
extends org.codehaus.plexus.logging.AbstractLogEnabled
implements org.apache.maven.plugin.Mojo

Support for packaging Mojos.

Version:
$Rev: 788216 $ $Date: 2009-06-24 17:06:45 -0700 (Wed, 24 Jun 2009) $

Nested Class Summary
protected  class AbstractCarMojo.ArtifactLookupImpl
           
 
Field Summary
protected  org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
          The artifact factory to use.
protected  org.apache.maven.artifact.repository.ArtifactRepository artifactRepository
           
protected  File basedir
          The basedir of the project.
protected  Set<org.apache.maven.artifact.Artifact> dependencies
           
protected  String encoding
          The character encoding scheme to be applied when filtering resources.
protected  String escapeString
          Expression preceded with the String won't be interpolated \${foo} will be replaced with ${foo}
protected  Set<org.apache.maven.artifact.Artifact> localDependencies
           
protected  org.apache.maven.shared.filtering.MavenFileFilter mavenFileFilter
           
protected  org.apache.maven.shared.filtering.MavenResourcesFiltering mavenResourcesFiltering
           
protected  org.apache.maven.project.MavenProject project
          The maven project.
protected  org.apache.maven.execution.MavenSession session
           
protected  String treeListing
           
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractCarMojo()
           
 
Method Summary
protected  void filter(File sourceFile, File targetFile)
           
protected  void generateExplicitVersionProperties(File outputFile, Set<org.apache.maven.artifact.Artifact> dependencies)
          Generates a properties file with explicit versions of artifacts of the current project transitivly.
protected  org.apache.maven.artifact.Artifact geronimoToMavenArtifact(Artifact artifact)
           
protected static File getArchiveFile(File basedir, String finalName, String classifier)
           
protected  org.apache.maven.artifact.repository.ArtifactRepository getArtifactRepository()
           
protected  void getDependencies(org.apache.maven.project.MavenProject project, boolean useTransitiveDependencies)
           
 org.apache.maven.plugin.logging.Log getLog()
           
protected  ArtifactType getModuleId()
           
protected  org.apache.maven.project.MavenProject getProject()
           
protected  boolean includeDependency(org.apache.maven.model.Dependency dependency)
           
protected  void init()
           
protected  boolean isModuleArtifact(Artifact artifact)
          Determine if the given artifact is a Geronimo module.
protected  Artifact mavenToGeronimoArtifact(org.apache.maven.artifact.Artifact artifact)
           
protected  Artifact mavenToGeronimoArtifact(org.apache.maven.model.Dependency artifact)
           
protected  org.apache.maven.artifact.Artifact resolveArtifact(String groupId, String artifactId, String type)
           
protected  org.apache.maven.model.Dependency resolveDependency(org.apache.maven.model.Dependency dependency, List<org.apache.maven.model.Dependency> artifacts)
           
 void setLog(org.apache.maven.plugin.logging.Log log)
           
protected  LinkedHashSet<Dependency> toDependencies(Collection<Dependency> listedDependencies, UseMavenDependencies useMavenDependencies, boolean includeImport)
           
protected static Dependency toGeronimoDependency(org.apache.maven.artifact.Artifact dependency, boolean includeVersion)
           
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.maven.plugin.Mojo
execute
 

Field Detail

project

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


basedir

protected File basedir
The basedir of the project.


dependencies

protected Set<org.apache.maven.artifact.Artifact> dependencies

localDependencies

protected Set<org.apache.maven.artifact.Artifact> localDependencies

artifactFactory

protected org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
The artifact factory to use.


treeListing

protected String treeListing

encoding

protected String encoding
The character encoding scheme to be applied when filtering resources.


mavenResourcesFiltering

protected org.apache.maven.shared.filtering.MavenResourcesFiltering mavenResourcesFiltering

session

protected org.apache.maven.execution.MavenSession session

escapeString

protected String escapeString
Expression preceded with the String won't be interpolated \${foo} will be replaced with ${foo}

Since:
2.3

mavenFileFilter

protected org.apache.maven.shared.filtering.MavenFileFilter mavenFileFilter

artifactRepository

protected org.apache.maven.artifact.repository.ArtifactRepository artifactRepository
Constructor Detail

AbstractCarMojo

public AbstractCarMojo()
Method Detail

getProject

protected org.apache.maven.project.MavenProject getProject()

getArtifactRepository

protected org.apache.maven.artifact.repository.ArtifactRepository getArtifactRepository()

init

protected void init()
             throws org.apache.maven.plugin.MojoExecutionException,
                    org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

generateExplicitVersionProperties

protected void generateExplicitVersionProperties(File outputFile,
                                                 Set<org.apache.maven.artifact.Artifact> dependencies)
                                          throws org.apache.maven.plugin.MojoExecutionException,
                                                 IOException
Generates a properties file with explicit versions of artifacts of the current project transitivly.

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

getArchiveFile

protected static File getArchiveFile(File basedir,
                                     String finalName,
                                     String classifier)

mavenToGeronimoArtifact

protected Artifact mavenToGeronimoArtifact(org.apache.maven.artifact.Artifact artifact)

mavenToGeronimoArtifact

protected Artifact mavenToGeronimoArtifact(org.apache.maven.model.Dependency artifact)

geronimoToMavenArtifact

protected org.apache.maven.artifact.Artifact geronimoToMavenArtifact(Artifact artifact)
                                                              throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

isModuleArtifact

protected boolean isModuleArtifact(Artifact artifact)
Determine if the given artifact is a Geronimo module.

Parameters:
artifact - The artifact to check; must not be null.
Returns:
True if the artifact is a Geronimo module.

includeDependency

protected boolean includeDependency(org.apache.maven.model.Dependency dependency)

resolveDependency

protected org.apache.maven.model.Dependency resolveDependency(org.apache.maven.model.Dependency dependency,
                                                              List<org.apache.maven.model.Dependency> artifacts)

getDependencies

protected void getDependencies(org.apache.maven.project.MavenProject project,
                               boolean useTransitiveDependencies)
                        throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

setLog

public void setLog(org.apache.maven.plugin.logging.Log log)
Specified by:
setLog in interface org.apache.maven.plugin.Mojo

getLog

public org.apache.maven.plugin.logging.Log getLog()
Specified by:
getLog in interface org.apache.maven.plugin.Mojo

toGeronimoDependency

protected static Dependency toGeronimoDependency(org.apache.maven.artifact.Artifact dependency,
                                                 boolean includeVersion)

toDependencies

protected LinkedHashSet<Dependency> toDependencies(Collection<Dependency> listedDependencies,
                                                   UseMavenDependencies useMavenDependencies,
                                                   boolean includeImport)
                                            throws org.apache.maven.project.artifact.InvalidDependencyVersionException,
                                                   org.apache.maven.artifact.resolver.ArtifactResolutionException,
                                                   org.apache.maven.project.ProjectBuildingException,
                                                   org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.project.artifact.InvalidDependencyVersionException
org.apache.maven.artifact.resolver.ArtifactResolutionException
org.apache.maven.project.ProjectBuildingException
org.apache.maven.plugin.MojoExecutionException

getModuleId

protected ArtifactType getModuleId()

resolveArtifact

protected org.apache.maven.artifact.Artifact resolveArtifact(String groupId,
                                                             String artifactId,
                                                             String type)

filter

protected void filter(File sourceFile,
                      File targetFile)
               throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException


Copyright © 2003-2009 The Apache Geronimo development community. All Rights Reserved.