org.apache.maven.plugin.source

Class AbstractJarSourceMojo

public abstract class AbstractJarSourceMojo extends AbstractMojo

Field Summary
protected StringfinalName
protected FileoutputDirectory
protected Stringpackaging
Method Summary
protected File[]addDirectories(List compileSourceRoots, List resources, File[] sourceDirectories)
Add the compile source directories and resource directories that will be included in the jar file
protected voidattachArtifact(File outputFile, String classifier)
Method to attach generated artifact to artifact list
protected voidcreateJar(File outputFile, File[] sourceDirectories, Archiver archiver)
Create jar file that contains the specified source directories
abstract voidexecute()
protected File[]getDefaultSources()
Get the main sources that will be included in the jar file
MavenProjectgetExecutedProject()
StringgetPackaging()
MavenProjectgetProject()
protected File[]getTestSources()
Get the test sources that will be included in the test sources jar file
voidsetExecutedProject(MavenProject executedProject)
voidsetPackaging(String packaging)
voidsetProject(MavenProject project)

Field Detail

finalName

protected String finalName

UNKNOWN: expression="${project.build.finalName}"

outputDirectory

protected File outputDirectory

UNKNOWN: expression="${project.build.directory}"

packaging

protected String packaging

UNKNOWN: expression="${project.packaging}"

Method Detail

addDirectories

protected File[] addDirectories(List compileSourceRoots, List resources, File[] sourceDirectories)
Add the compile source directories and resource directories that will be included in the jar file

Parameters: compileSourceRoots resources sourceDirectories

Returns: an array of File objects that contains the directories that will be included in the jar file

attachArtifact

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

Parameters: outputFile the artifact file to be attached classifier

createJar

protected void createJar(File outputFile, File[] sourceDirectories, Archiver archiver)
Create jar file that contains the specified source directories

Parameters: outputFile the file name of the jar sourceDirectories the source directories that will be included in the jar file

execute

public abstract void execute()

getDefaultSources

protected File[] getDefaultSources()
Get the main sources that will be included in the jar file

Returns: an array of File objects that contains the source directories

getExecutedProject

public MavenProject getExecutedProject()

getPackaging

public String getPackaging()

getProject

public MavenProject getProject()

getTestSources

protected File[] getTestSources()
Get the test sources that will be included in the test sources jar file

Returns: an array of File objects that contains the test source directories

setExecutedProject

public void setExecutedProject(MavenProject executedProject)

setPackaging

public void setPackaging(String packaging)

setProject

public void setProject(MavenProject project)
Copyright © 2002-2009 Apache Software Foundation. All Rights Reserved.