org.apache.maven.plugin.source
Class AbstractJarSourceMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugin.source.AbstractJarSourceMojo
- All Implemented Interfaces:
- org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
- JarDefaultSourceMojo, JarTestSourceMojo
public abstract class AbstractJarSourceMojo
- extends org.apache.maven.plugin.AbstractMojo
Fields inherited from interface org.apache.maven.plugin.Mojo |
ROLE |
Method Summary |
protected java.io.File[] |
addDirectories(java.util.List compileSourceRoots,
java.util.List resources,
java.io.File[] sourceDirectories)
Add the compile source directories and resource directories that will be included in the jar file |
protected void |
attachArtifact(java.io.File outputFile,
java.lang.String classifier)
Method to attach generated artifact to artifact list |
protected void |
createJar(java.io.File outputFile,
java.io.File[] sourceDirectories,
org.codehaus.plexus.archiver.Archiver archiver)
Create jar file that contains the specified source directories |
abstract void |
execute()
|
protected java.io.File[] |
getDefaultSources()
Get the main sources that will be included in the jar file |
org.apache.maven.project.MavenProject |
getExecutedProject()
|
java.lang.String |
getPackaging()
|
org.apache.maven.project.MavenProject |
getProject()
|
protected java.io.File[] |
getTestSources()
Get the test sources that will be included in the test sources jar file |
void |
setExecutedProject(org.apache.maven.project.MavenProject executedProject)
|
void |
setPackaging(java.lang.String packaging)
|
void |
setProject(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 |
packaging
protected java.lang.String packaging
outputDirectory
protected java.io.File outputDirectory
finalName
protected java.lang.String finalName
AbstractJarSourceMojo
public AbstractJarSourceMojo()
execute
public abstract void execute()
throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
getProject
public org.apache.maven.project.MavenProject getProject()
setProject
public void setProject(org.apache.maven.project.MavenProject project)
getPackaging
public java.lang.String getPackaging()
setPackaging
public void setPackaging(java.lang.String packaging)
getExecutedProject
public org.apache.maven.project.MavenProject getExecutedProject()
setExecutedProject
public void setExecutedProject(org.apache.maven.project.MavenProject executedProject)
addDirectories
protected java.io.File[] addDirectories(java.util.List compileSourceRoots,
java.util.List resources,
java.io.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
getTestSources
protected java.io.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
getDefaultSources
protected java.io.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
createJar
protected void createJar(java.io.File outputFile,
java.io.File[] sourceDirectories,
org.codehaus.plexus.archiver.Archiver archiver)
throws java.io.IOException,
org.codehaus.plexus.archiver.ArchiverException
- Create jar file that contains the specified source directories
- Parameters:
outputFile
- the file name of the jarsourceDirectories
- the source directories that will be included in the jar file
- Throws:
java.io.IOException
org.codehaus.plexus.archiver.ArchiverException
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 attachedclassifier
-
Copyright © 2002-2007 Apache Software Foundation. All Rights Reserved.