com.sun.enterprise.module.maven
Class PackageMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by com.sun.enterprise.module.maven.PackageMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class PackageMojo
extends org.apache.maven.plugin.AbstractMojo

Creates a jar with a special manifest entry.

Mostly copied from JarMojo. See http://jira.codehaus.org/browse/MNG-2789 why we can't rely on it.

Author:
Kohsuke Kawaguchi

Field Summary
protected  org.apache.maven.archiver.MavenArchiveConfiguration archive
          The maven archive configuration to use.
protected  File classesDirectory
          Directory containing the classes.
protected  String[] excludes
          Ant glob patterns to be excluded from the jar file, like "**/*.bak" The base directory for the pattern is specified in classesDirectory.
protected  String finalName
          Name of the generated JAR.
protected  org.codehaus.plexus.archiver.jar.JarArchiver jarArchiver
          The Jar archiver.
protected  File outputDirectory
          Directory containing the generated JAR.
protected  org.apache.maven.project.MavenProject project
          The maven project.
protected  org.apache.maven.project.MavenProjectHelper projectHelper
           
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
PackageMojo()
           
 
Method Summary
 File createArchive()
          Generates the JAR.
 void execute()
          Generates the JAR.
protected static File getJarFile(File basedir, String finalName)
           
protected  org.apache.maven.project.MavenProject getProject()
           
 
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 Detail

outputDirectory

protected File outputDirectory
Directory containing the generated JAR.


finalName

protected String finalName
Name of the generated JAR.


jarArchiver

protected org.codehaus.plexus.archiver.jar.JarArchiver jarArchiver
The Jar archiver.


project

protected org.apache.maven.project.MavenProject project
The maven project.


archive

protected org.apache.maven.archiver.MavenArchiveConfiguration archive
The maven archive configuration to use.

See the Javadocs for MavenArchiveConfiguration.


projectHelper

protected org.apache.maven.project.MavenProjectHelper projectHelper

classesDirectory

protected File classesDirectory
Directory containing the classes.


excludes

protected String[] excludes
Ant glob patterns to be excluded from the jar file, like "**/*.bak" The base directory for the pattern is specified in classesDirectory.

Constructor Detail

PackageMojo

public PackageMojo()
Method Detail

getProject

protected final org.apache.maven.project.MavenProject getProject()

getJarFile

protected static File getJarFile(File basedir,
                                 String finalName)

createArchive

public File createArchive()
                   throws org.apache.maven.plugin.MojoExecutionException
Generates the JAR.

Throws:
org.apache.maven.plugin.MojoExecutionException

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Generates the JAR.

Throws:
org.apache.maven.plugin.MojoExecutionException


Copyright © 2012 Oracle Corporation. All Rights Reserved.