Add Package in manifest from plugin configuration.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163515 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Emmanuel Venisse 2005-03-10 09:36:44 +00:00
parent 97ad0f7800
commit de167c3e10
3 changed files with 23 additions and 5 deletions

View File

@ -51,6 +51,8 @@ public class MavenArchiver
String mainClass = (String) request.getParameter( "mainClass" );
String packageName = (String) request.getParameter( "package" );
boolean addClasspath = new Boolean( (String) request.getParameter( "addClasspath" ) ).booleanValue();
boolean addExtensions = new Boolean( (String) request.getParameter( "addExtensions" ) ).booleanValue();
@ -61,10 +63,13 @@ public class MavenArchiver
m.addConfiguredAttribute( buildAttr );
Manifest.Attribute createdAttr = new Manifest.Attribute( "Created-By", "Apache Maven" );
m.addConfiguredAttribute( createdAttr );
/* TODO: need to add jar plugin config
Manifest.Attribute packageAttr = new Manifest.Attribute( "Package", project.getPackage() );
m.addConfiguredAttribute( packageAttr );
*/
if ( packageName != null )
{
Manifest.Attribute packageAttr = new Manifest.Attribute( "Package", packageName );
m.addConfiguredAttribute( packageAttr );
}
Manifest.Attribute buildJdkAttr = new Manifest.Attribute( "Build-Jdk", System.getProperty( "java.version" ) );
m.addConfiguredAttribute( buildJdkAttr );

View File

@ -17,6 +17,7 @@ package org.apache.maven.plugin.jar;
*/
import org.apache.maven.archiver.MavenArchiver;
import org.apache.maven.plugin.AbstractPlugin;
import org.apache.maven.plugin.PluginExecutionRequest;
import org.apache.maven.plugin.PluginExecutionResponse;
@ -48,6 +49,12 @@ import java.io.File;
* expression="#maven.jar.index"
* default="false"
* description=""
* @parameter name="package"
* type="String"
* required="false"
* validator=""
* expression="#maven.jar.package"
* description=""
* @parameter name="manifest"
* type="String"
* required="false"
@ -94,7 +101,7 @@ import java.io.File;
* description="current MavenProject instance"
*/
public class JarMojo
extends AbstractJarMojo
extends AbstractPlugin
{
/**
* @todo Add license files in META-INF directory.

View File

@ -56,6 +56,12 @@ import java.util.Set;
* expression="#maven.jar.index"
* default="false"
* description=""
* @parameter name="package"
* type="String"
* required="false"
* validator=""
* expression="#maven.jar.package"
* description=""
* @parameter name="manifest"
* type="String"
* required="false"