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
maven-archiver/src/main/java/org/apache/maven/archiver
maven-plugins
maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar
maven-war-plugin/src/main/java/org/apache/maven/plugin/war
|
@ -51,6 +51,8 @@ public class MavenArchiver
|
||||||
|
|
||||||
String mainClass = (String) request.getParameter( "mainClass" );
|
String mainClass = (String) request.getParameter( "mainClass" );
|
||||||
|
|
||||||
|
String packageName = (String) request.getParameter( "package" );
|
||||||
|
|
||||||
boolean addClasspath = new Boolean( (String) request.getParameter( "addClasspath" ) ).booleanValue();
|
boolean addClasspath = new Boolean( (String) request.getParameter( "addClasspath" ) ).booleanValue();
|
||||||
|
|
||||||
boolean addExtensions = new Boolean( (String) request.getParameter( "addExtensions" ) ).booleanValue();
|
boolean addExtensions = new Boolean( (String) request.getParameter( "addExtensions" ) ).booleanValue();
|
||||||
|
@ -61,10 +63,13 @@ public class MavenArchiver
|
||||||
m.addConfiguredAttribute( buildAttr );
|
m.addConfiguredAttribute( buildAttr );
|
||||||
Manifest.Attribute createdAttr = new Manifest.Attribute( "Created-By", "Apache Maven" );
|
Manifest.Attribute createdAttr = new Manifest.Attribute( "Created-By", "Apache Maven" );
|
||||||
m.addConfiguredAttribute( createdAttr );
|
m.addConfiguredAttribute( createdAttr );
|
||||||
/* TODO: need to add jar plugin config
|
|
||||||
Manifest.Attribute packageAttr = new Manifest.Attribute( "Package", project.getPackage() );
|
if ( packageName != null )
|
||||||
m.addConfiguredAttribute( packageAttr );
|
{
|
||||||
*/
|
Manifest.Attribute packageAttr = new Manifest.Attribute( "Package", packageName );
|
||||||
|
m.addConfiguredAttribute( packageAttr );
|
||||||
|
}
|
||||||
|
|
||||||
Manifest.Attribute buildJdkAttr = new Manifest.Attribute( "Build-Jdk", System.getProperty( "java.version" ) );
|
Manifest.Attribute buildJdkAttr = new Manifest.Attribute( "Build-Jdk", System.getProperty( "java.version" ) );
|
||||||
m.addConfiguredAttribute( buildJdkAttr );
|
m.addConfiguredAttribute( buildJdkAttr );
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@ package org.apache.maven.plugin.jar;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import org.apache.maven.archiver.MavenArchiver;
|
import org.apache.maven.archiver.MavenArchiver;
|
||||||
|
import org.apache.maven.plugin.AbstractPlugin;
|
||||||
import org.apache.maven.plugin.PluginExecutionRequest;
|
import org.apache.maven.plugin.PluginExecutionRequest;
|
||||||
import org.apache.maven.plugin.PluginExecutionResponse;
|
import org.apache.maven.plugin.PluginExecutionResponse;
|
||||||
|
|
||||||
|
@ -48,6 +49,12 @@ import java.io.File;
|
||||||
* expression="#maven.jar.index"
|
* expression="#maven.jar.index"
|
||||||
* default="false"
|
* default="false"
|
||||||
* description=""
|
* description=""
|
||||||
|
* @parameter name="package"
|
||||||
|
* type="String"
|
||||||
|
* required="false"
|
||||||
|
* validator=""
|
||||||
|
* expression="#maven.jar.package"
|
||||||
|
* description=""
|
||||||
* @parameter name="manifest"
|
* @parameter name="manifest"
|
||||||
* type="String"
|
* type="String"
|
||||||
* required="false"
|
* required="false"
|
||||||
|
@ -94,7 +101,7 @@ import java.io.File;
|
||||||
* description="current MavenProject instance"
|
* description="current MavenProject instance"
|
||||||
*/
|
*/
|
||||||
public class JarMojo
|
public class JarMojo
|
||||||
extends AbstractJarMojo
|
extends AbstractPlugin
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @todo Add license files in META-INF directory.
|
* @todo Add license files in META-INF directory.
|
||||||
|
|
|
@ -56,6 +56,12 @@ import java.util.Set;
|
||||||
* expression="#maven.jar.index"
|
* expression="#maven.jar.index"
|
||||||
* default="false"
|
* default="false"
|
||||||
* description=""
|
* description=""
|
||||||
|
* @parameter name="package"
|
||||||
|
* type="String"
|
||||||
|
* required="false"
|
||||||
|
* validator=""
|
||||||
|
* expression="#maven.jar.package"
|
||||||
|
* description=""
|
||||||
* @parameter name="manifest"
|
* @parameter name="manifest"
|
||||||
* type="String"
|
* type="String"
|
||||||
* required="false"
|
* required="false"
|
||||||
|
|
Loading…
Reference in New Issue