org.apache.maven.archiver

## Class ManifestConfiguration

- java.lang.Object
- - org.apache.maven.archiver.ManifestConfiguration

    public class ManifestConfiguration
    extends Object

Capture common manifest configuration.

Version:
  $Id: ManifestConfiguration.java 1748291 2016-06-13 18:00:20Z rfscholte $
Author:
  Brett Porter

### Field Summary

Fields
`static String` `CLASSPATH_LAYOUT_TYPE_CUSTOM` custom layout type.
`static String` `CLASSPATH_LAYOUT_TYPE_REPOSITORY` The layout type
`static String` `CLASSPATH_LAYOUT_TYPE_SIMPLE` The simple layout.

### Constructor Summary

Constructors
Constructor and Description
`ManifestConfiguration()`

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `getClasspathLayoutType()` Return the type of layout to use when formatting classpath entries.
`String` `getClasspathPrefix()`
`String` `getCustomClasspathLayout()` Retrieve the layout expression for use when the layout type set in `setClasspathLayoutType(String)` has the value 'custom'.
`String` `getMainClass()`
`String` `getPackageName()`
`boolean` `isAddClasspath()`
`boolean` `isAddDefaultImplementationEntries()`
`boolean` `isAddDefaultSpecificationEntries()`
`boolean` `isAddExtensions()`
`boolean` `isUseUniqueVersions()` Retrieve the flag for whether snapshot artifacts should be added to the classpath using the timestamp/buildnumber version (the default, when this flag is true), or using the generic -SNAPSHOT version (when the flag is false).
`void` `setAddClasspath(boolean addClasspath)`
`void` `setAddDefaultImplementationEntries(boolean addDefaultImplementationEntries)`
`void` `setAddDefaultSpecificationEntries(boolean addDefaultSpecificationEntries)`
`void` `setAddExtensions(boolean addExtensions)`
`void` `setClasspathLayoutType(String classpathLayoutType)` Set the type of layout to use when formatting classpath entries.
`void` `setClasspathPrefix(String classpathPrefix)`
`void` `setCustomClasspathLayout(String customClasspathLayout)` Set the layout expression for use when the layout type set in `setClasspathLayoutType(String)` has the value 'custom'.
`void` `setMainClass(String mainClass)`
`void` `setPackageName(String packageName)`
`void` `setUseUniqueVersions(boolean useUniqueVersions)` Set the flag for whether snapshot artifacts should be added to the classpath using the timestamp/buildnumber version (the default, when this flag is true), or using the generic -SNAPSHOT version (when the flag is false).

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### CLASSPATH_LAYOUT_TYPE_SIMPLE

    public static final String CLASSPATH_LAYOUT_TYPE_SIMPLE

The simple layout.

See Also:
  Constant Field Values

#### CLASSPATH_LAYOUT_TYPE_REPOSITORY

    public static final String CLASSPATH_LAYOUT_TYPE_REPOSITORY

The layout type

See Also:
  Constant Field Values

#### CLASSPATH_LAYOUT_TYPE_CUSTOM

    public static final String CLASSPATH_LAYOUT_TYPE_CUSTOM

custom layout type.

See Also:
  Constant Field Values

### Constructor Detail

#### ManifestConfiguration

    public ManifestConfiguration()

### Method Detail

#### getMainClass

    public String getMainClass()

Returns:
  mainClass

#### getPackageName

    public String getPackageName()

Returns:
  the package name.

#### isAddClasspath

    public boolean isAddClasspath()

Returns:
  if addClasspath true or false.

#### isAddDefaultImplementationEntries

    public boolean isAddDefaultImplementationEntries()

Returns:
  `addDefaultImplementationEntries`

#### isAddDefaultSpecificationEntries

    public boolean isAddDefaultSpecificationEntries()

Returns:
  `addDefaultSpecificationEntries`

#### isAddExtensions

    public boolean isAddExtensions()

Returns:
  `addExtensions`

#### setAddClasspath

    public void setAddClasspath(boolean addClasspath)

Parameters:
  `addClasspath` - turn on addClasspath or off.

#### setAddDefaultImplementationEntries

    public void setAddDefaultImplementationEntries(boolean addDefaultImplementationEntries)

Parameters:
  `addDefaultImplementationEntries` - true to add default implementations false otherwise.

#### setAddDefaultSpecificationEntries

    public void setAddDefaultSpecificationEntries(boolean addDefaultSpecificationEntries)

Parameters:
  `addDefaultSpecificationEntries` - add default specifications true/false.

#### setAddExtensions

    public void setAddExtensions(boolean addExtensions)

Parameters:
  `addExtensions` - true to add extensions false otherwise.

#### setClasspathPrefix

    public void setClasspathPrefix(String classpathPrefix)

Parameters:
  `classpathPrefix` - The prefix.

#### setMainClass

    public void setMainClass(String mainClass)

Parameters:
  `mainClass` - The main class.

#### setPackageName

    public void setPackageName(String packageName)

Parameters:
  `packageName` - The package name.

#### getClasspathPrefix

    public String getClasspathPrefix()

Returns:
  The classpath prefix.

#### getClasspathLayoutType

    public String getClasspathLayoutType()

Return the type of layout to use when formatting classpath entries. Default is taken from the constant CLASSPATH_LAYOUT_TYPE_SIMPLE, declared in this class, which has a value of 'simple'. Other values are: 'repository' (CLASSPATH_LAYOUT_TYPE_REPOSITORY, or the same as a maven classpath layout), and 'custom' (CLASSPATH_LAYOUT_TYPE_CUSTOM).
NOTE: If you specify a type of 'custom' you MUST set `setCustomClasspathLayout(String)`.

Returns:
  The classpath layout type.

#### setClasspathLayoutType

    public void setClasspathLayoutType(String classpathLayoutType)

Set the type of layout to use when formatting classpath entries. Should be one of: 'simple' (CLASSPATH_LAYOUT_TYPE_SIMPLE), 'repository' (CLASSPATH_LAYOUT_TYPE_REPOSITORY, or the same as a maven classpath layout), and 'custom' (CLASSPATH_LAYOUT_TYPE_CUSTOM). The constant names noted here are defined in the `ManifestConfiguration` class.
NOTE: If you specify a type of 'custom' you MUST set `setCustomClasspathLayout(String)`.

Parameters:
  `classpathLayoutType` - The classpath layout type.

#### getCustomClasspathLayout

    public String getCustomClasspathLayout()

Retrieve the layout expression for use when the layout type set in `setClasspathLayoutType(String)` has the value 'custom'. The default value is null. Expressions will be evaluated against the following ordered list of classpath-related objects:

1. The current `Artifact` instance, if one exists.
2. The current `ArtifactHandler` instance from the artifact above.

NOTE: If you specify a layout type of 'custom' you MUST set this layout expression.

Returns:
  The custom classpath layout.

#### setCustomClasspathLayout

    public void setCustomClasspathLayout(String customClasspathLayout)

Set the layout expression for use when the layout type set in `setClasspathLayoutType(String)` has the value 'custom'. Expressions will be evaluated against the following ordered list of classpath-related objects:

1. The current `Artifact` instance, if one exists.
2. The current `ArtifactHandler` instance from the artifact above.

NOTE: If you specify a layout type of 'custom' you MUST set this layout expression. You can take a look at

1. `MavenArchiver.SIMPLE_LAYOUT`
2. `MavenArchiver.SIMPLE_LAYOUT_NONUNIQUE`
3. `MavenArchiver.REPOSITORY_LAYOUT`
4. `MavenArchiver.REPOSITORY_LAYOUT_NONUNIQUE`

how such an expression looks like.

Parameters:
  `customClasspathLayout` - The custom classpath layout.

#### isUseUniqueVersions

    public boolean isUseUniqueVersions()

Retrieve the flag for whether snapshot artifacts should be added to the classpath using the timestamp/buildnumber version (the default, when this flag is true), or using the generic -SNAPSHOT version (when the flag is false).
NOTE: If the snapshot was installed locally, this flag will not have an effect on that artifact's inclusion, since it will have the same version either way (i.e. -SNAPSHOT naming).

Returns:
  The state of `useUniqueVersions`

#### setUseUniqueVersions

    public void setUseUniqueVersions(boolean useUniqueVersions)

Set the flag for whether snapshot artifacts should be added to the classpath using the timestamp/buildnumber version (the default, when this flag is true), or using the generic -SNAPSHOT version (when the flag is false).
NOTE: If the snapshot was installed locally, this flag will not have an effect on that artifact's inclusion, since it will have the same version either way (i.e. -SNAPSHOT naming).

Parameters:
  `useUniqueVersions` - true to use unique versions or not.