org.codehaus.mojo.appassembler
Class AbstractAppAssemblerMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.appassembler.AbstractAppAssemblerMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
Direct Known Subclasses:
AbstractScriptGeneratorMojo, CreateRepositoryMojo

public abstract class AbstractAppAssemblerMojo
extends org.apache.maven.plugin.AbstractMojo
implements org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable

This is intended to summarize all generic parts of the Mojos into a single class. First step of refactoring code.

Author:
Karl Heinz Marbaise

Field Summary
protected  org.apache.maven.artifact.repository.ArtifactRepositoryFactory artifactRepositoryFactory
           
protected  org.codehaus.plexus.PlexusContainer container
          A reference to the Plexus container so that we can do our own component lookups, which was required to solve MAPPASM-96.
protected  org.apache.maven.artifact.repository.ArtifactRepository localRepository
           
protected  String outputFileNameMapping
          The file name mapping to use when copying libraries to the repository.
protected  org.apache.maven.artifact.Artifact projectArtifact
           
protected  String repositoryLayout
          The layout of the generated Maven repository.
protected  boolean useTimestampInSnapshotFileName
          For those snapshots downloaded from a remote repo, replace the timestamp part with "SNAPSHOT" instead.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractAppAssemblerMojo()
           
 
Method Summary
 void contextualize(org.codehaus.plexus.context.Context context)
          
protected  org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout getArtifactRepositoryLayout()
           
protected  void installArtifact(org.apache.maven.artifact.Artifact artifact, org.apache.maven.artifact.repository.ArtifactRepository artifactRepository)
          Copy artifact to another repository.
protected  void installArtifact(org.apache.maven.artifact.Artifact artifact, org.apache.maven.artifact.repository.ArtifactRepository artifactRepository, boolean useTimestampInSnapshotFileName)
          Copy artifact to another repository, with an option not to use timestamp in the snapshot filename.
 
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
 
Methods inherited from interface org.apache.maven.plugin.Mojo
execute
 

Field Detail

outputFileNameMapping

protected String outputFileNameMapping
The file name mapping to use when copying libraries to the repository. If no file mapping is set (default) the files are copied with their standard names.

Note: if you use this parameter, then the useTimestampInSnapshotFileName parameter will be ignored.

Since:
1.5

repositoryLayout

protected String repositoryLayout
The layout of the generated Maven repository. Supported types - "default" (Maven2) | "legacy" (Maven1) | "flat" (flat lib/ style). The style "legacy" is only supported if you are running under Maven 2.2.1 and before.


useTimestampInSnapshotFileName

protected boolean useTimestampInSnapshotFileName
For those snapshots downloaded from a remote repo, replace the timestamp part with "SNAPSHOT" instead.

Since:
1.2.3 (create-repository), 1.3 (assemble and generate-daemons)

localRepository

protected org.apache.maven.artifact.repository.ArtifactRepository localRepository

projectArtifact

protected org.apache.maven.artifact.Artifact projectArtifact

artifactRepositoryFactory

protected org.apache.maven.artifact.repository.ArtifactRepositoryFactory artifactRepositoryFactory

container

protected org.codehaus.plexus.PlexusContainer container
A reference to the Plexus container so that we can do our own component lookups, which was required to solve MAPPASM-96.

Constructor Detail

AbstractAppAssemblerMojo

public AbstractAppAssemblerMojo()
Method Detail

contextualize

public void contextualize(org.codehaus.plexus.context.Context context)
                   throws org.codehaus.plexus.context.ContextException

Specified by:
contextualize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
Throws:
org.codehaus.plexus.context.ContextException

getArtifactRepositoryLayout

protected org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout getArtifactRepositoryLayout()
                                                                                                    throws org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoFailureException

installArtifact

protected void installArtifact(org.apache.maven.artifact.Artifact artifact,
                               org.apache.maven.artifact.repository.ArtifactRepository artifactRepository,
                               boolean useTimestampInSnapshotFileName)
                        throws org.apache.maven.plugin.MojoExecutionException
Copy artifact to another repository, with an option not to use timestamp in the snapshot filename.

Parameters:
artifact - The artifact to install.
artifactRepository - The repository where to install.
useTimestampInSnapshotFileName - Using timestamp for SNAPSHOT's.
Throws:
org.apache.maven.plugin.MojoExecutionException

installArtifact

protected void installArtifact(org.apache.maven.artifact.Artifact artifact,
                               org.apache.maven.artifact.repository.ArtifactRepository artifactRepository)
                        throws org.apache.maven.plugin.MojoExecutionException
Copy artifact to another repository.

Parameters:
artifact -
artifactRepository -
Throws:
org.apache.maven.plugin.MojoExecutionException


Copyright © 2006-2013 Codehaus. All Rights Reserved.