Package org.apache.maven.archiver
Class ManifestConfiguration
java.lang.Object
org.apache.maven.archiver.ManifestConfiguration
Capture common manifest configuration.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
Add build environment information about Maven, JDK, and OS.private boolean
private boolean
Add default, reproducible entriesCreated-By
andBuild-Jdk-Spec
.private boolean
Add default implementation entries if this is an extension.private boolean
Add default implementation entries if this is an extension specification.private boolean
static final String
custom layout type.static final String
The layout typestatic final String
The simple layout.private String
private String
This gets prefixed to all classpath entries.private String
private String
private String
private boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the type of layout to use when formatting classpath entries.Retrieve the layout expression for use when the layout type set insetClasspathLayoutType(String)
has the value 'custom'.boolean
boolean
boolean
boolean
boolean
boolean
boolean
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
setAddBuildEnvironmentEntries
(boolean addBuildEnvironmentEntries) void
setAddClasspath
(boolean addClasspath) void
setAddDefaultEntries
(boolean addDefaultEntries) 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 insetClasspathLayoutType(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).
-
Field Details
-
CLASSPATH_LAYOUT_TYPE_SIMPLE
The simple layout.- See Also:
-
CLASSPATH_LAYOUT_TYPE_REPOSITORY
The layout type- See Also:
-
CLASSPATH_LAYOUT_TYPE_CUSTOM
custom layout type.- See Also:
-
mainClass
-
packageName
-
addClasspath
private boolean addClasspath -
addExtensions
private boolean addExtensions -
classpathPrefix
This gets prefixed to all classpath entries. -
addDefaultEntries
private boolean addDefaultEntriesAdd default, reproducible entriesCreated-By
andBuild-Jdk-Spec
.- Since:
- 3.4.0
-
addBuildEnvironmentEntries
private boolean addBuildEnvironmentEntriesAdd build environment information about Maven, JDK, and OS.- Since:
- 3.4.0
-
addDefaultSpecificationEntries
private boolean addDefaultSpecificationEntriesAdd default implementation entries if this is an extension specification.- Since:
- 2.1
-
addDefaultImplementationEntries
private boolean addDefaultImplementationEntriesAdd default implementation entries if this is an extension.- Since:
- 2.1
-
classpathLayoutType
-
customClasspathLayout
-
useUniqueVersions
private boolean useUniqueVersions
-
-
Constructor Details
-
ManifestConfiguration
public ManifestConfiguration()
-
-
Method Details
-
getMainClass
- Returns:
- mainClass
-
getPackageName
- Returns:
- the package name.
-
isAddClasspath
public boolean isAddClasspath()- Returns:
- if addClasspath true or false.
-
isAddDefaultEntries
public boolean isAddDefaultEntries()- Returns:
addDefaultEntries
-
isAddBuildEnvironmentEntries
public boolean isAddBuildEnvironmentEntries()- Returns:
addBuildEnvironmentEntries
-
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.
-
setAddDefaultEntries
public void setAddDefaultEntries(boolean addDefaultEntries) - Parameters:
addDefaultEntries
- add default entries true/false.
-
setAddBuildEnvironmentEntries
public void setAddBuildEnvironmentEntries(boolean addBuildEnvironmentEntries) - Parameters:
addBuildEnvironmentEntries
- add build environment information true/false.
-
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
- Parameters:
classpathPrefix
- The prefix.
-
setMainClass
- Parameters:
mainClass
- The main class.
-
setPackageName
- Parameters:
packageName
- The package name.
-
getClasspathPrefix
- Returns:
- The classpath prefix.
-
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 setsetCustomClasspathLayout(String)
.- Returns:
- The classpath layout type.
-
setClasspathLayoutType
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 theManifestConfiguration
class.
NOTE: If you specify a type of 'custom' you MUST setsetCustomClasspathLayout(String)
.- Parameters:
classpathLayoutType
- The classpath layout type.
-
getCustomClasspathLayout
Retrieve the layout expression for use when the layout type set insetClasspathLayoutType(String)
has the value 'custom'. The default value is null. Expressions will be evaluated against the following ordered list of classpath-related objects:- The current
Artifact
instance, if one exists. - 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.
- The current
-
setCustomClasspathLayout
Set the layout expression for use when the layout type set insetClasspathLayoutType(String)
has the value 'custom'. Expressions will be evaluated against the following ordered list of classpath-related objects:- The current
Artifact
instance, if one exists. - 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 how such an expression looks like.- Parameters:
customClasspathLayout
- The custom classpath layout.
- The current
-
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.
-