mirror of https://github.com/apache/maven.git
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:
parent
97ad0f7800
commit
de167c3e10
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue