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  java.io.File classesDirectory
          Directory containing the classes.
protected  java.lang.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  java.lang.String finalName
          Name of the generated JAR.
protected  org.codehaus.plexus.archiver.jar.JarArchiver jarArchiver
          The Jar archiver.
protected  java.io.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
 java.io.File createArchive()
          Generates the JAR.
 void execute()
          Generates the JAR.
protected static java.io.File getJarFile(java.io.File basedir, java.lang.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 java.io.File outputDirectory
Directory containing the generated JAR.


finalName

protected java.lang.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 java.io.File classesDirectory
Directory containing the classes.


excludes

protected java.lang.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 java.io.File getJarFile(java.io.File basedir,
                                         java.lang.String finalName)

createArchive

public java.io.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 © 2011 Oracle Corporation. All Rights Reserved.