Class SiteJarMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="jar", defaultPhase=PACKAGE, requiresDependencyResolution=TEST, requiresReports=true, threadSafe=true) public class SiteJarMojo extends SiteMojoBundles the site output into a JAR so that it can be deployed to a repository.- Since:
- 2.0-beta-6
-
-
Field Summary
Fields Modifier and Type Field Description private org.apache.maven.archiver.MavenArchiveConfigurationarchiveThe archive configuration to use.private java.lang.String[]archiveExcludesList of files to exclude.private java.lang.String[]archiveIncludesList of files to include.private booleanattachSpecifies whether to attach the generated artifact to the project.private static java.lang.String[]DEFAULT_ARCHIVE_EXCLUDESprivate static java.lang.String[]DEFAULT_ARCHIVE_INCLUDESprivate java.lang.StringfinalNameSpecifies the filename that will be used for the generated jar file.private org.codehaus.plexus.archiver.jar.JarArchiverjarArchiverThe Jar archiver.private java.lang.StringjarOutputDirectorySpecifies the directory where the generated jar file will be put.private org.apache.maven.project.MavenProjectHelperprojectHelperUsed for attaching the artifact in the project.-
Fields inherited from class org.apache.maven.plugins.site.render.SiteMojo
outputDirectory
-
Fields inherited from class org.apache.maven.plugins.site.render.AbstractSiteRenderingMojo
generatedSiteDirectory, mavenReportExecutor, mavenSession, mojoExecution, outputTimestamp, siteRenderer
-
Fields inherited from class org.apache.maven.plugins.site.descriptor.AbstractSiteDescriptorMojo
reactorProjects, remoteProjectRepositories, repoSession, siteDirectory
-
Fields inherited from class org.apache.maven.plugins.site.AbstractSiteMojo
i18n, project, siteTool, skip
-
-
Constructor Summary
Constructors Constructor Description SiteJarMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.io.FilecreateArchive(java.io.File siteDirectory, java.lang.String jarFilename)Method that creates the jar file.voidexecute()private java.lang.String[]getArchiveExcludes()private java.lang.String[]getArchiveIncludes()protected java.lang.StringgetArtifactType()protected java.lang.StringgetClassifier()-
Methods inherited from class org.apache.maven.plugins.site.render.SiteMojo
getProject, getSession
-
Methods inherited from class org.apache.maven.plugins.site.render.AbstractSiteRenderingMojo
categoriseReports, checkInputEncoding, createSiteRenderingContext, getInputEncoding, getOutputEncoding, getReports, locateDocuments, locateReports, populateReportItems
-
Methods inherited from class org.apache.maven.plugins.site.descriptor.AbstractSiteDescriptorMojo
prepareSiteModel
-
Methods inherited from class org.apache.maven.plugins.site.AbstractSiteMojo
getLocales
-
-
-
-
Field Detail
-
DEFAULT_ARCHIVE_EXCLUDES
private static final java.lang.String[] DEFAULT_ARCHIVE_EXCLUDES
-
DEFAULT_ARCHIVE_INCLUDES
private static final java.lang.String[] DEFAULT_ARCHIVE_INCLUDES
-
jarOutputDirectory
@Parameter(property="project.build.directory", required=true) private java.lang.String jarOutputDirectorySpecifies the directory where the generated jar file will be put.
-
finalName
@Parameter(property="project.build.finalName", required=true) private java.lang.String finalNameSpecifies the filename that will be used for the generated jar file. Please note that "-site" will be appended to the file name.
-
projectHelper
@Component private org.apache.maven.project.MavenProjectHelper projectHelper
Used for attaching the artifact in the project.
-
attach
@Parameter(property="site.attach", defaultValue="true") private boolean attachSpecifies whether to attach the generated artifact to the project.
-
jarArchiver
@Component(role=org.codehaus.plexus.archiver.Archiver.class, hint="jar") private org.codehaus.plexus.archiver.jar.JarArchiver jarArchiverThe Jar archiver.- Since:
- 3.1
-
archive
@Parameter private org.apache.maven.archiver.MavenArchiveConfiguration archive
The archive configuration to use. See Maven Archiver Reference.- Since:
- 3.1
-
archiveIncludes
@Parameter private java.lang.String[] archiveIncludes
List of files to include. Specified as file set patterns which are relative to the input directory whose contents is being packaged into the JAR.- Since:
- 3.1
-
archiveExcludes
@Parameter private java.lang.String[] archiveExcludes
List of files to exclude. Specified as file set patterns which are relative to the input directory whose contents is being packaged into the JAR.- Since:
- 3.1
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureExceptionDescription copied from class:SiteMojo
-
getArtifactType
protected java.lang.String getArtifactType()
-
getClassifier
protected java.lang.String getClassifier()
-
createArchive
private java.io.File createArchive(java.io.File siteDirectory, java.lang.String jarFilename) throws org.codehaus.plexus.archiver.ArchiverException, java.io.IOException, org.codehaus.plexus.archiver.jar.ManifestException, org.apache.maven.artifact.DependencyResolutionRequiredExceptionMethod that creates the jar file.- Parameters:
siteDirectory- the directory where the site files are locatedjarFilename- the filename of the created jar file- Returns:
- a File object that contains the created jar file
- Throws:
org.codehaus.plexus.archiver.ArchiverExceptionjava.io.IOExceptionorg.codehaus.plexus.archiver.jar.ManifestExceptionorg.apache.maven.artifact.DependencyResolutionRequiredException
-
getArchiveIncludes
private java.lang.String[] getArchiveIncludes()
-
getArchiveExcludes
private java.lang.String[] getArchiveExcludes()
-
-