Overview
HOWTOs
Deprecated

nbm:manifest

Full name:

org.netbeans.maven:nbm-maven-plugin:4.2-SNAPSHOT:manifest

Description:

Goal for generating NetBeans module system specific manifest entries, part of nbm lifecycle/packaging. In order to have the generated manifest picked up by the maven-jar-plugin, one shall add the following configuration snippet to maven-jar-plugin.
 
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory/META-INF/MANIFEST.MF</manifestfile>
</archive>
</configuration>
</plugin>
}

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: runtime.
  • Binds by default to the lifecycle phase: process-classes.

Required Parameters

Name Type Since Description
sourceManifestFile File - Path to manifest file that will be used as base and enhanced with generated content. Any entry specified in the original file will not be overwritten
Default value is: ${basedir}/src/main/nbm/manifest.mf.

Optional Parameters

Name Type Since Description
codeNameBase String - codename base of the module, uniquely identifying the module within the NetBeans runtime. usually the package name equivalent. Can include the major release version. See NetBeans Module system docs
Default value is: ${project.groupId}.${project.artifactId}.
descriptor File - Deprecated. all content from the module descriptor can be defined as plugin configuration now, will be removed in 4.0 entirely
Default value is: ${basedir}/src/main/nbm/module.xml.
moduleDependencies Dependency[] - List of explicit module dependency declarations overriding the default specification dependency. Useful when depending on a range of major versions, depending on implementation version etc.

The format is:

<dependency>
   <id>groupId:artifactId</id>
   <type>spec|impl|loose</type>
   <explicitValue>the entire dependency token</explicitValue>
</dependency>


where id is composed of grouId and artifactId of a dependency defined in effective pom, separated by double colon. This is mandatory.

Then there are 2 exclusively optional fields type and explicitValue, if both are defined explicitValue gets applied.

type values: spec means specification dependency.That's the default. impl means implementation dependency, only the exact version match will satisfy the constraint. loose means loose dependency, no requirement on version, the module just has to be present. Not very common option.


moduleType String - Deployment type of the module, allowed values are normal,eager,autoload, disabled.

autoload - Such a module is automatically enabled when some other module requires it and automatically disabled otherwise.

eager - This module type gets automatically enabled when all it's dependencies are satisfied. Disabled otherwise.

normal - This is the default value. This kind of module is enabled/disabled manually by the user. It installs enabled.

disabled - This kind of module is enabled/disabled manually by the user. It installs disabled. Since 3.11

For details, see Netbeans Module system docs Since 3.14, for autoload and eager modules, we automatically set AutoUpdate-Show-In-Client manifest entry to false, if not defined already otherwise in the manifest. See issue MNBMODULE-194
Default value is: normal.
nbmBuildDir File - NetBeans module assembly build directory. directory where the the NetBeans jar and nbm file get constructed.
Default value is: ${project.build.directory}/nbm.
User property is: maven.nbm.buildDir.
nbmJavahelpSource File - The location of JavaHelp sources for the project. The documentation itself is expected to be in the directory structure based on codenamebase of the module. eg. if your codenamebase is "org.netbeans.modules.apisupport", then the actual docs files shall go to ${basedir}/src/main/javahelp/org/netbeans/modules/apisupport/docs. Obsolete as of NetBeans 7.0 with @HelpSetRegistration.
Default value is: ${basedir}/src/main/javahelp.
publicPackages List - A list of module's public packages. If not defined, no packages are exported as public. Allowed values are single package names or package names ending with .* which represent the package and all subpackages. Eg. "org.kleint.milos.api" designates just the one package, while "org.kleint.milos.spi.*" denotes the spi package an all it's subpackages.
useOSGiDependencies boolean - When encountering an OSGi bundle among dependencies, the plugin will generate a direct dependency on the bundle and will not include the bundle's jar into the nbm. Will only work with NetBeans 6.9+ runtime. Therefore it is off by default. WARNING: Additionally existing applications/modules need to check modules wrapping external libraries for library jars that are also OSGi bundles. Such modules will no longer include the OSGi bundles as part of the module but will include a modular dependency on the bundle. Modules depending on these old wrappers shall depend directly on the bundle, eventually rendering the old library wrapper module obsolete.
Default value is: false.
verifyRuntime String - Verify the runtime NetBeans module dependencies and Class-Path items generated from Maven dependencies. The check is done by matching classes used in current project. Allowed values for the parameter are fail, warn and skip. The default is fail in which case the validation failure results in a failed build, in the vast majority of cases the module would fail at runtime anyway.
Default value is: fail.
User property is: maven.nbm.verify.

Parameter Details

codeNameBase:

codename base of the module, uniquely identifying the module within the NetBeans runtime. usually the package name equivalent. Can include the major release version. See NetBeans Module system docs
  • Type: java.lang.String
  • Required: No
  • Default: ${project.groupId}.${project.artifactId}

descriptor:

Deprecated. all content from the module descriptor can be defined as plugin configuration now, will be removed in 4.0 entirely
a NetBeans module descriptor containing dependency information and more
  • Type: java.io.File
  • Required: No
  • Default: ${basedir}/src/main/nbm/module.xml

moduleDependencies:

List of explicit module dependency declarations overriding the default specification dependency. Useful when depending on a range of major versions, depending on implementation version etc.

The format is:

<dependency>
   <id>groupId:artifactId</id>
   <type>spec|impl|loose</type>
   <explicitValue>the entire dependency token</explicitValue>
</dependency>


where id is composed of grouId and artifactId of a dependency defined in effective pom, separated by double colon. This is mandatory.

Then there are 2 exclusively optional fields type and explicitValue, if both are defined explicitValue gets applied.

type values: spec means specification dependency.That's the default. impl means implementation dependency, only the exact version match will satisfy the constraint. loose means loose dependency, no requirement on version, the module just has to be present. Not very common option.

  • Type: org.netbeans.nbm.model.Dependency[]
  • Required: No

moduleType:

Deployment type of the module, allowed values are normal,eager,autoload, disabled.

autoload - Such a module is automatically enabled when some other module requires it and automatically disabled otherwise.

eager - This module type gets automatically enabled when all it's dependencies are satisfied. Disabled otherwise.

normal - This is the default value. This kind of module is enabled/disabled manually by the user. It installs enabled.

disabled - This kind of module is enabled/disabled manually by the user. It installs disabled. Since 3.11

For details, see Netbeans Module system docs Since 3.14, for autoload and eager modules, we automatically set AutoUpdate-Show-In-Client manifest entry to false, if not defined already otherwise in the manifest. See issue MNBMODULE-194
  • Type: java.lang.String
  • Required: No
  • Default: normal

nbmBuildDir:

NetBeans module assembly build directory. directory where the the NetBeans jar and nbm file get constructed.
  • Type: java.io.File
  • Required: No
  • User Property: maven.nbm.buildDir
  • Default: ${project.build.directory}/nbm

nbmJavahelpSource:

The location of JavaHelp sources for the project. The documentation itself is expected to be in the directory structure based on codenamebase of the module. eg. if your codenamebase is "org.netbeans.modules.apisupport", then the actual docs files shall go to ${basedir}/src/main/javahelp/org/netbeans/modules/apisupport/docs. Obsolete as of NetBeans 7.0 with @HelpSetRegistration.
  • Type: java.io.File
  • Required: No
  • Default: ${basedir}/src/main/javahelp

publicPackages:

A list of module's public packages. If not defined, no packages are exported as public. Allowed values are single package names or package names ending with .* which represent the package and all subpackages. Eg. "org.kleint.milos.api" designates just the one package, while "org.kleint.milos.spi.*" denotes the spi package an all it's subpackages.
  • Type: java.util.List
  • Required: No

sourceManifestFile:

Path to manifest file that will be used as base and enhanced with generated content. Any entry specified in the original file will not be overwritten
  • Type: java.io.File
  • Required: Yes
  • Default: ${basedir}/src/main/nbm/manifest.mf

useOSGiDependencies:

When encountering an OSGi bundle among dependencies, the plugin will generate a direct dependency on the bundle and will not include the bundle's jar into the nbm. Will only work with NetBeans 6.9+ runtime. Therefore it is off by default. WARNING: Additionally existing applications/modules need to check modules wrapping external libraries for library jars that are also OSGi bundles. Such modules will no longer include the OSGi bundles as part of the module but will include a modular dependency on the bundle. Modules depending on these old wrappers shall depend directly on the bundle, eventually rendering the old library wrapper module obsolete.
  • Type: boolean
  • Required: No
  • Default: false

verifyRuntime:

Verify the runtime NetBeans module dependencies and Class-Path items generated from Maven dependencies. The check is done by matching classes used in current project. Allowed values for the parameter are fail, warn and skip. The default is fail in which case the validation failure results in a failed build, in the vast majority of cases the module would fail at runtime anyway.
  • Type: java.lang.String
  • Required: No
  • User Property: maven.nbm.verify
  • Default: fail