Fork me on GitHub

slingfeature:apis-jar

Full name:

org.apache.sling:slingfeature-maven-plugin:1.7.2:apis-jar

Description:

Generates the APIs JARs for the selected feature files.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: test.
  • The goal is thread-safe and supports parallel builds.
  • Binds by default to the lifecycle phase: package.

Required Parameters

Name Type Since Description
<features> File - Directory containing feature files
Default value is: src/main/features.
<testFeatures> File - Directory containing test feature files.
Default value is: src/test/features.

Optional Parameters

Name Type Since Description
<apiClassifierMappings> Map - Mapping for the feature classifier to a user defined name
<apiJavadocResources> List - Additional resources for the api javadoc jar
<apiName> String 1.5.6 Optional artifact name which is used instead of the generated artifact name to set some headers in the manifest.
<apiRegionNameMappings> Map - Mapping for an api region name to a user defined name
<apiRepositoryUrls> String 1.3.0 Comma separated list of Maven repository lists. If set, and useApiDependencies is enabled, then one of the listed repositories must provide the artifact. If it is not set, all artifacts are used as dependencies if useApiDependencies is enabled.
<apiResources> List - Additional resources for the api jar
<apiSourceResources> List - Additional resources for the api source jar
<apiVersion> String 1.2.0 Optional version to be put into the manifest of the created jars
<attachApiJars> boolean - If enabled, the created api jars will be attached to the project
Default value is: true.
<enableLegacyVariableReplacement> boolean 1.3.6 Enable old variable replacement in feature model based on the full maven project including system variables. If this is enabled, enableProjectVariableReplacement and replacePropertyVariables have no effect.
Default value is: false.
<enableProjectVariableReplacement> boolean 1.3.6 Enable the replacement of variables when reading a feature model. The supported variables are "project.groupId", "project.artifactId", "project.version" and "project.osgiVersion".
Default value is: true.
<enabledToggles> String 1.5.0 A comma separated list of enabled toggles used as input to generate the api jars.
User property is: enabled.toggles.
<excludeRegions> Set - Names of the regions to exclude, by default no regions is excluded.
<failOnError> boolean 1.3.2 Fail the build if errors are detected. For example, errors could be missing packages in the api jars, or too many packages in those jars.
Default value is: false.
<failOnMissingSourcesForJavadoc> boolean 1.3.6 Fail the build if sources are mising for javadoc generation
Default value is: false.
<featuresExcludes> String - Comma separated list of excludes for the feature files. Feature files excluded by this configuration are not processed at all.
<featuresIncludes> String - Comma separated list of includes for the feature files in the configured directory. Only feature files specified by this include are processed.
Default value is: **/*.json.
<generateApiJar> boolean - Generate api jar
Default value is: true.
<generateJavadocForAllApi> boolean 1.5.2 If useApiDependencies is set to true and useApiDependenciesForJavadoc is set to true this can be set to false to generate an additional javadoc API jar with all javadoc including the API from dependencies.
Default value is: false.
<generateJavadocJar> boolean - Generate the javadoc jar
Default value is: true.
<generateSourceJar> boolean - Generate the sources jar
Default value is: true.
<generatedFeatures> File - Directory containing generated feature files
<generatedFeaturesExcludes> String - Comma separated list of excludes for the generated feature files. Feature files excluded by this configuration are not processed at all.
<generatedFeaturesIncludes> String - Comma separated list of includes for the generated feature files in the configured directory. Only feature files specified by this include are processed.
Default value is: **/*.json.
<ignoreJavadocErrors> boolean - Ignore errors in javadoc generation
Default value is: false.
<includeRegions> Set - Names of the regions to include, by default all regions are included.
Default value is: *.
<includeResources> String[] - Patterns identifying which resources to include from bundles. This can be used to include files like license or notices files. Starting with version 1.2.0 these files are only searched in the folders mentioned by #resourceFolders
<incrementalApis> boolean - If set to true and api jars are created for more than one region, then the higher region only gets the difference to the lower region. If set to false each api jar gets the full region information (duplicating information)
Default value is: true.
<jarStartOrder> int - The start level for the attached jar/bundle.
<javadocAdditionalExtensions> List 1.5.0 A list of configurations to add additional artifacts to a region for javadoc generation. The value is a comma separated list of extension names from the feature model. If such an extension exists, it must be of type artifacts. The list of names can be prefixed with a region name separated by a colon from the list of names. In that case, the artifacts are only added to that region.
<javadocClasspathHighestVersions> List 1.3.14 A artifact patterns to match artifacts put on the javadoc classpath. Follows the pattern "groupId:artifactId:type:classifier:version". From the matching artifacts, only the highest version is kept per artifact. This rule is applied after the removals.
<javadocClasspathRemovals> List 1.3.14 A artifact patterns to match artifacts put on the javadoc classpath. Follows the pattern "groupId:artifactId:type:classifier:version". Any matching artifact is removed from the classpath. Removals are processed first.
<javadocClasspathTops> List 1.3.14 A artifact patterns to match artifacts put on the javadoc classpath. Follows the pattern "groupId:artifactId:type:classifier:version". Any matching artifact is put at the top of the classpath. This rule is applied last.
<javadocIndex> boolean 1.3.6 Whether the index should be generated
Default value is: true.
<javadocLinks> String[] - List of javadoc links used in the javadoc generation.
<javadocSourceLevel> String - Source level for javadoc generation
Default value is: 8.
<javadocTree> boolean 1.3.6 Whether the tree should be generated
Default value is: true.
<licenseDefaults> List 1.2.0 A artifact patterns to match artifacts without a license. Follows the pattern "groupId:artifactId:type:classifier:version". After the patter a "=" followed by the license information needs to be specified. This information is used in the license report if no license is specified for an artifact.
<licenseReport> String 1.2.0 Create a license report file. This is the name of that file within the jar
<licenseReportFooter> String 1.2.0 Footer added at the bottom of the license report
<licenseReportHeader> String 1.2.0 Header added on top of the license report
Default value is: This archive contains files from the following artifacts:.
<manifestProperties> Properties 1.3.2 specify the manifest properties values that you need to replace in the Manifest file.
<replacePropertyVariables> String 1.3.6 A comma separated list of variables which are replaced when a feature model is read. The value of these variables is fetched from the project properties.
<resourceFolders> String 1.2.0 Comma separated list of folders where files are renamed.
Default value is: META-INF,SLING-INF.
<selection> FeatureSelectionConfig - Select the features for api generation. Separate api jars will be generated for each feature.
<skipAddFeatureDependencies> boolean - If set to true the artifacts from the feature are not as dependencies to the project.
Default value is: false.
<skipAddJarToFeature> boolean - If set to true the main jar artifact is not added to the feature.
Default value is: false.
<skipAddJarToTestFeature> boolean - If set to true the main jar artifact is not added to the test feature.
Default value is: false.
<skipAddTestFeatureDependencies> boolean - If set to true the artifacts from the test feature are not as dependencies to the project.
Default value is: true.
<testFeaturesExcludes> String - Comma separated list of excludes for the test features.
<testFeaturesIncludes> String - Comma separated list of includes for the test features.
Default value is: **/*.json.
<toggleApiOnly> boolean 1.4.26 If set to true the apis jar will only contain api which is behind the enabled toggles. All other public api is not included. If set to false (the default) all public api is included per region.
Default value is: false.
<useApiDependencies> boolean 1.3.0 If enabled, packages from artifacts which are fully consumed (all public api) are omitted from the api and source jars and a dependency list is generated instead.
Default value is: false.
<useApiDependenciesForJavadoc> boolean 1.5.2 If this is set to false the javadoc generated will always contain all APIs even the api from dependencies (if useApiDependencies) is enabled. If this is set to true the javadoc will not contain the API from dependencies and exactly match the binary and source jars.
Default value is: false.
<validateFeatures> boolean - If set to true the features are validated against the JSON schema.
Default value is: true.

Parameter Details

<apiClassifierMappings>

Mapping for the feature classifier to a user defined name
  • Type: java.util.Map
  • Required: No

<apiJavadocResources>

Additional resources for the api javadoc jar
  • Type: java.util.List
  • Required: No

<apiName>

Optional artifact name which is used instead of the generated artifact name to set some headers in the manifest.
  • Type: java.lang.String
  • Since: 1.5.6
  • Required: No

<apiRegionNameMappings>

Mapping for an api region name to a user defined name
  • Type: java.util.Map
  • Required: No

<apiRepositoryUrls>

Comma separated list of Maven repository lists. If set, and useApiDependencies is enabled, then one of the listed repositories must provide the artifact. If it is not set, all artifacts are used as dependencies if useApiDependencies is enabled.
  • Type: java.lang.String
  • Since: 1.3.0
  • Required: No

<apiResources>

Additional resources for the api jar
  • Type: java.util.List
  • Required: No

<apiSourceResources>

Additional resources for the api source jar
  • Type: java.util.List
  • Required: No

<apiVersion>

Optional version to be put into the manifest of the created jars
  • Type: java.lang.String
  • Since: 1.2.0
  • Required: No

<attachApiJars>

If enabled, the created api jars will be attached to the project
  • Type: boolean
  • Required: No
  • Default: true

<enableLegacyVariableReplacement>

Enable old variable replacement in feature model based on the full maven project including system variables. If this is enabled, enableProjectVariableReplacement and replacePropertyVariables have no effect.
  • Type: boolean
  • Since: 1.3.6
  • Required: No
  • Default: false

<enableProjectVariableReplacement>

Enable the replacement of variables when reading a feature model. The supported variables are "project.groupId", "project.artifactId", "project.version" and "project.osgiVersion".
  • Type: boolean
  • Since: 1.3.6
  • Required: No
  • Default: true

<enabledToggles>

A comma separated list of enabled toggles used as input to generate the api jars.
  • Type: java.lang.String
  • Since: 1.5.0
  • Required: No
  • User Property: enabled.toggles

<excludeRegions>

Names of the regions to exclude, by default no regions is excluded.
  • Type: java.util.Set
  • Required: No

<failOnError>

Fail the build if errors are detected. For example, errors could be missing packages in the api jars, or too many packages in those jars.
  • Type: boolean
  • Since: 1.3.2
  • Required: No
  • Default: false

<failOnMissingSourcesForJavadoc>

Fail the build if sources are mising for javadoc generation
  • Type: boolean
  • Since: 1.3.6
  • Required: No
  • Default: false

<features>

Directory containing feature files
  • Type: java.io.File
  • Required: Yes
  • Default: src/main/features

<featuresExcludes>

Comma separated list of excludes for the feature files. Feature files excluded by this configuration are not processed at all.
  • Type: java.lang.String
  • Required: No

<featuresIncludes>

Comma separated list of includes for the feature files in the configured directory. Only feature files specified by this include are processed.
  • Type: java.lang.String
  • Required: No
  • Default: **/*.json

<generateApiJar>

Generate api jar
  • Type: boolean
  • Required: No
  • Default: true

<generateJavadocForAllApi>

If useApiDependencies is set to true and useApiDependenciesForJavadoc is set to true this can be set to false to generate an additional javadoc API jar with all javadoc including the API from dependencies.
  • Type: boolean
  • Since: 1.5.2
  • Required: No
  • Default: false

<generateJavadocJar>

Generate the javadoc jar
  • Type: boolean
  • Required: No
  • Default: true

<generateSourceJar>

Generate the sources jar
  • Type: boolean
  • Required: No
  • Default: true

<generatedFeatures>

Directory containing generated feature files
  • Type: java.io.File
  • Required: No

<generatedFeaturesExcludes>

Comma separated list of excludes for the generated feature files. Feature files excluded by this configuration are not processed at all.
  • Type: java.lang.String
  • Required: No

<generatedFeaturesIncludes>

Comma separated list of includes for the generated feature files in the configured directory. Only feature files specified by this include are processed.
  • Type: java.lang.String
  • Required: No
  • Default: **/*.json

<ignoreJavadocErrors>

Ignore errors in javadoc generation
  • Type: boolean
  • Required: No
  • Default: false

<includeRegions>

Names of the regions to include, by default all regions are included.
  • Type: java.util.Set
  • Required: No
  • Default: *

<includeResources>

Patterns identifying which resources to include from bundles. This can be used to include files like license or notices files. Starting with version 1.2.0 these files are only searched in the folders mentioned by #resourceFolders
  • Type: java.lang.String[]
  • Required: No

<incrementalApis>

If set to true and api jars are created for more than one region, then the higher region only gets the difference to the lower region. If set to false each api jar gets the full region information (duplicating information)
  • Type: boolean
  • Required: No
  • Default: true

<jarStartOrder>

The start level for the attached jar/bundle.
  • Type: int
  • Required: No

<javadocAdditionalExtensions>

A list of configurations to add additional artifacts to a region for javadoc generation. The value is a comma separated list of extension names from the feature model. If such an extension exists, it must be of type artifacts. The list of names can be prefixed with a region name separated by a colon from the list of names. In that case, the artifacts are only added to that region.
  • Type: java.util.List
  • Since: 1.5.0
  • Required: No

<javadocClasspathHighestVersions>

A artifact patterns to match artifacts put on the javadoc classpath. Follows the pattern "groupId:artifactId:type:classifier:version". From the matching artifacts, only the highest version is kept per artifact. This rule is applied after the removals.
  • Type: java.util.List
  • Since: 1.3.14
  • Required: No

<javadocClasspathRemovals>

A artifact patterns to match artifacts put on the javadoc classpath. Follows the pattern "groupId:artifactId:type:classifier:version". Any matching artifact is removed from the classpath. Removals are processed first.
  • Type: java.util.List
  • Since: 1.3.14
  • Required: No

<javadocClasspathTops>

A artifact patterns to match artifacts put on the javadoc classpath. Follows the pattern "groupId:artifactId:type:classifier:version". Any matching artifact is put at the top of the classpath. This rule is applied last.
  • Type: java.util.List
  • Since: 1.3.14
  • Required: No

<javadocIndex>

Whether the index should be generated
  • Type: boolean
  • Since: 1.3.6
  • Required: No
  • Default: true

<javadocLinks>

List of javadoc links used in the javadoc generation.
  • Type: java.lang.String[]
  • Required: No

<javadocSourceLevel>

Source level for javadoc generation
  • Type: java.lang.String
  • Required: No
  • Default: 8

<javadocTree>

Whether the tree should be generated
  • Type: boolean
  • Since: 1.3.6
  • Required: No
  • Default: true

<licenseDefaults>

A artifact patterns to match artifacts without a license. Follows the pattern "groupId:artifactId:type:classifier:version". After the patter a "=" followed by the license information needs to be specified. This information is used in the license report if no license is specified for an artifact.
  • Type: java.util.List
  • Since: 1.2.0
  • Required: No

<licenseReport>

Create a license report file. This is the name of that file within the jar
  • Type: java.lang.String
  • Since: 1.2.0
  • Required: No

<licenseReportFooter>

Footer added at the bottom of the license report
  • Type: java.lang.String
  • Since: 1.2.0
  • Required: No

<licenseReportHeader>

Header added on top of the license report
  • Type: java.lang.String
  • Since: 1.2.0
  • Required: No
  • Default: This archive contains files from the following artifacts:

<manifestProperties>

specify the manifest properties values that you need to replace in the Manifest file.
  • Type: java.util.Properties
  • Since: 1.3.2
  • Required: No

<replacePropertyVariables>

A comma separated list of variables which are replaced when a feature model is read. The value of these variables is fetched from the project properties.
  • Type: java.lang.String
  • Since: 1.3.6
  • Required: No

<resourceFolders>

Comma separated list of folders where files are renamed.
  • Type: java.lang.String
  • Since: 1.2.0
  • Required: No
  • Default: META-INF,SLING-INF

<selection>

Select the features for api generation. Separate api jars will be generated for each feature.
  • Type: org.apache.sling.feature.maven.mojos.FeatureSelectionConfig
  • Required: No

<skipAddFeatureDependencies>

If set to true the artifacts from the feature are not as dependencies to the project.
  • Type: boolean
  • Required: No
  • Default: false

<skipAddJarToFeature>

If set to true the main jar artifact is not added to the feature.
  • Type: boolean
  • Required: No
  • Default: false

<skipAddJarToTestFeature>

If set to true the main jar artifact is not added to the test feature.
  • Type: boolean
  • Required: No
  • Default: false

<skipAddTestFeatureDependencies>

If set to true the artifacts from the test feature are not as dependencies to the project.
  • Type: boolean
  • Required: No
  • Default: true

<testFeatures>

Directory containing test feature files.
  • Type: java.io.File
  • Required: Yes
  • Default: src/test/features

<testFeaturesExcludes>

Comma separated list of excludes for the test features.
  • Type: java.lang.String
  • Required: No

<testFeaturesIncludes>

Comma separated list of includes for the test features.
  • Type: java.lang.String
  • Required: No
  • Default: **/*.json

<toggleApiOnly>

If set to true the apis jar will only contain api which is behind the enabled toggles. All other public api is not included. If set to false (the default) all public api is included per region.
  • Type: boolean
  • Since: 1.4.26
  • Required: No
  • Default: false

<useApiDependencies>

If enabled, packages from artifacts which are fully consumed (all public api) are omitted from the api and source jars and a dependency list is generated instead.
  • Type: boolean
  • Since: 1.3.0
  • Required: No
  • Default: false

<useApiDependenciesForJavadoc>

If this is set to false the javadoc generated will always contain all APIs even the api from dependencies (if useApiDependencies) is enabled. If this is set to true the javadoc will not contain the API from dependencies and exactly match the binary and source jars.
  • Type: boolean
  • Since: 1.5.2
  • Required: No
  • Default: false

<validateFeatures>

If set to true the features are validated against the JSON schema.
  • Type: boolean
  • Required: No
  • Default: true