Class SiteJarMojo

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 SiteMojo
Bundles the site output into a JAR so that it can be deployed to a repository.
Since:
2.0-beta-6
  • Field Details

    • DEFAULT_ARCHIVE_EXCLUDES

      private static final String[] DEFAULT_ARCHIVE_EXCLUDES
    • DEFAULT_ARCHIVE_INCLUDES

      private static final String[] DEFAULT_ARCHIVE_INCLUDES
    • jarOutputDirectory

      @Parameter(property="project.build.directory", required=true) private String jarOutputDirectory
      Specifies the directory where the generated jar file will be put.
    • finalName

      @Parameter(property="project.build.finalName", required=true) private String finalName
      Specifies 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 attach
      Specifies 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 jarArchiver
      The 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 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 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
  • Constructor Details

    • SiteJarMojo

      public SiteJarMojo()
  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Description copied from class: SiteMojo
      Specified by:
      execute in interface org.apache.maven.plugin.Mojo
      Overrides:
      execute in class SiteMojo
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
      See Also:
      • Mojo.execute()
    • getArtifactType

      protected String getArtifactType()
    • getClassifier

      protected String getClassifier()
    • createArchive

      private File createArchive(File siteDirectory, String jarFilename) throws org.codehaus.plexus.archiver.ArchiverException, IOException, org.codehaus.plexus.archiver.jar.ManifestException, org.apache.maven.artifact.DependencyResolutionRequiredException
      Method that creates the jar file.
      Parameters:
      siteDirectory - the directory where the site files are located
      jarFilename - the filename of the created jar file
      Returns:
      a File object that contains the created jar file
      Throws:
      org.codehaus.plexus.archiver.ArchiverException
      IOException
      org.codehaus.plexus.archiver.jar.ManifestException
      org.apache.maven.artifact.DependencyResolutionRequiredException
    • getArchiveIncludes

      private String[] getArchiveIncludes()
    • getArchiveExcludes

      private String[] getArchiveExcludes()