Class AbstractSourceJarMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.eclipse.tycho.source.AbstractSourceJarMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
OsgiSourceMojo

public abstract class AbstractSourceJarMojo extends org.apache.maven.plugin.AbstractMojo
Base class for bundling sources into a jar archive.
Since:
2.0.3
Version:
$Id: AbstractSourceJarMojo.java 763422 2009-04-08 21:59:54Z pgier $
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
    Specifies whether or not to exclude resources from the sources-jar.
    protected String
    The filename to be used for the generated archive file.
    protected boolean
    Specifies whether or not to include the POM file in the sources-jar.
    protected File
    The directory where the generated archive file will be put.
    protected org.apache.maven.project.MavenProject
    The Maven Project Object
    protected List<org.apache.maven.project.MavenProject>
    Contains the full list of projects in the reactor.
    protected org.apache.maven.execution.MavenSession
    The Maven Session Object

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    addDirectory(org.codehaus.plexus.archiver.Archiver archiver, File sourceDirectory, String[] includes, String[] excludes)
     
    protected void
    addDirectory(org.codehaus.plexus.archiver.Archiver archiver, File sourceDirectory, String prefix, String[] includes, String[] excludes)
     
    protected void
    archiveProjectContent(org.apache.maven.project.MavenProject p, org.codehaus.plexus.archiver.Archiver archiver)
     
    protected org.apache.maven.archiver.MavenArchiver
     
    void
    protected abstract String
     
    protected String
     
    protected org.apache.maven.project.MavenProject
    getProject(org.apache.maven.project.MavenProject p)
     
    protected abstract List<org.apache.maven.model.Resource>
    getResources(org.apache.maven.project.MavenProject p)
     
    protected abstract List<org.apache.maven.model.Resource>
    getSources(org.apache.maven.project.MavenProject p)
     
    protected String
     
    protected abstract boolean
    isRelevantProject(org.apache.maven.project.MavenProject p)
     
    protected void
    packageSources(List<org.apache.maven.project.MavenProject> projects)
     
    protected void
    packageSources(org.apache.maven.project.MavenProject p)
     
    protected void
    updateSourceManifest(org.apache.maven.archiver.MavenArchiveConfiguration mavenArchiveConfiguration)
     

    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 Details

    • project

      @Parameter(property="project", readonly=true, required=true) protected org.apache.maven.project.MavenProject project
      The Maven Project Object
    • session

      @Parameter(property="session", readonly=true) protected org.apache.maven.execution.MavenSession session
      The Maven Session Object
    • excludeResources

      @Parameter(property="source.excludeResources", defaultValue="false") protected boolean excludeResources
      Specifies whether or not to exclude resources from the sources-jar. This can be convenient if your project includes large resources, such as images, and you don't want to include them in the sources-jar.
      Since:
      2.0.4
    • includePom

      @Parameter(property="source.includePom", defaultValue="false") protected boolean includePom
      Specifies whether or not to include the POM file in the sources-jar.
      Since:
      2.1
    • outputDirectory

      @Parameter(property="project.build.directory") protected File outputDirectory
      The directory where the generated archive file will be put.
    • finalName

      @Parameter(property="project.build.finalName") protected 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.
    • reactorProjects

      @Parameter(property="reactorProjects", readonly=true) protected List<org.apache.maven.project.MavenProject> reactorProjects
      Contains the full list of projects in the reactor.
  • Constructor Details

    • AbstractSourceJarMojo

      public AbstractSourceJarMojo()
  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • getClassifier

      protected abstract String getClassifier()
      Returns:
      the wanted classifier, i.e. sources or test-sources
    • getSources

      protected abstract List<org.apache.maven.model.Resource> getSources(org.apache.maven.project.MavenProject p) throws org.apache.maven.plugin.MojoExecutionException
      Parameters:
      p - not null
      Returns:
      the compile or test sources
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • getResources

      protected abstract List<org.apache.maven.model.Resource> getResources(org.apache.maven.project.MavenProject p) throws org.apache.maven.plugin.MojoExecutionException
      Parameters:
      p - not null
      Returns:
      the compile or test resources
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • packageSources

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

      protected abstract boolean isRelevantProject(org.apache.maven.project.MavenProject p)
    • packageSources

      protected void packageSources(List<org.apache.maven.project.MavenProject> projects) throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • updateSourceManifest

      protected void updateSourceManifest(org.apache.maven.archiver.MavenArchiveConfiguration mavenArchiveConfiguration)
    • archiveProjectContent

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

      protected org.apache.maven.archiver.MavenArchiver createArchiver() throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • addDirectory

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

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

      protected String getExtension()
    • getProject

      protected org.apache.maven.project.MavenProject getProject(org.apache.maven.project.MavenProject p)
    • getType

      protected String getType()