org.apache.maven.plugin.source
Class AbstractSourceJarMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugin.source.AbstractSourceJarMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
SourceJarMojo, TestSourceJarMojo

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


Field Summary
protected  java.lang.String finalName
          The filename to be used for the generated archive file.
protected  java.io.File outputDirectory
          The directory where the generated archive file will be put.
protected  org.apache.maven.project.MavenProject project
           
protected  java.util.List reactorProjects
           
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractSourceJarMojo()
           
 
Method Summary
protected  void addDirectory(org.codehaus.plexus.archiver.Archiver archiver, java.io.File sourceDirectory, java.lang.String[] includes, java.lang.String[] excludes)
           
protected  void archiveProjectContent(org.apache.maven.project.MavenProject project, org.codehaus.plexus.archiver.Archiver archiver)
           
protected  void attachArtifact(java.io.File outputFile, java.lang.String classifier)
          Method to attach generated artifact to artifact list
protected  org.codehaus.plexus.archiver.Archiver createArchiver()
           
 void execute()
           
protected abstract  java.lang.String getClassifier()
           
protected  org.apache.maven.project.MavenProject getProject(org.apache.maven.project.MavenProject project)
           
protected abstract  java.util.List getResources(org.apache.maven.project.MavenProject project)
           
protected abstract  java.util.List getSources(org.apache.maven.project.MavenProject project)
           
protected  void packageSources(java.util.List projects)
           
protected  void packageSources(org.apache.maven.project.MavenProject project)
           
 
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

project

protected org.apache.maven.project.MavenProject project

outputDirectory

protected java.io.File outputDirectory
The directory where the generated archive file will be put. Defaults to ${project.build.directory} specified in the pom or inherited from the super pom.


finalName

protected java.lang.String finalName
The filename to be used for the generated archive file. For the source:jar goal, "-sources" is appended to this filename. For the source:test-jar goal, "-test-sources" is appended. Defaults to ${project.build.finalName} specified in the pom or inherited from the super pom.


reactorProjects

protected java.util.List reactorProjects
Constructor Detail

AbstractSourceJarMojo

public AbstractSourceJarMojo()
Method Detail

getClassifier

protected abstract java.lang.String getClassifier()

getSources

protected abstract java.util.List getSources(org.apache.maven.project.MavenProject project)

getResources

protected abstract java.util.List getResources(org.apache.maven.project.MavenProject project)

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException
See Also:
Mojo.execute()

packageSources

protected void packageSources(org.apache.maven.project.MavenProject project)
                       throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

packageSources

protected void packageSources(java.util.List projects)
                       throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

archiveProjectContent

protected void archiveProjectContent(org.apache.maven.project.MavenProject project,
                                     org.codehaus.plexus.archiver.Archiver archiver)
                              throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

attachArtifact

protected void attachArtifact(java.io.File outputFile,
                              java.lang.String classifier)
Method to attach generated artifact to artifact list

Parameters:
outputFile - the artifact file to be attached
classifier -

createArchiver

protected org.codehaus.plexus.archiver.Archiver createArchiver()
                                                        throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

addDirectory

protected void addDirectory(org.codehaus.plexus.archiver.Archiver archiver,
                            java.io.File sourceDirectory,
                            java.lang.String[] includes,
                            java.lang.String[] excludes)
                     throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

getProject

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


Copyright © 2002-2011 Apache Software Foundation. All Rights Reserved.