test isolation of workspaces
1 file changed
tree: a3da649b5a1b7ae031d8b619621eb70bdef77fde
  1. src/
  2. .gitignore
  3. .sling-module.json
  6. Jenkinsfile
  8. pom.xml
  9. README.md

Apache Sling

Build Status Test Status Coverage Sonarcloud Status JavaDoc Maven Central License

Apache Sling Maven Enforcer Rules

This module is part of the Apache Sling project.

It provides additional Maven Enforcer rules.


Require Provided Dependencies in Runtime Classpath

Checks that the runtime classpath (e.g. used by Maven Plugins via the Plugin Classloader or by the Appassembler Maven Plugin's assemble goal) contains all provided dependencies.

As those are not transitively inherited they need to be declared explicitly in the pom.xml of the using Maven project.

The check assumes semantic versioning, i.e. for provided dependencies without a version range all compatible runtime dependencies are accepted (i.e. ones that share groupId, artifactId, classifier and extension, and have the same major version and minor version which is equal or higher to the one of the provided dependency.


All parameters are optional.

  • excludes - a list of dependencies to skip. Their transitive dependencies are not evaluated either. The format is <groupId>[:<artifactId>[:<extension>[:<classifier>]]]. Wild cards (*) may be used to replace an entire part of a section. Examples:
    • org.apache.maven (everything with the given group)
    • org.apache.maven:myArtifact
    • org.apache.maven:*:jar
  • includeOptionalDependencies - whether to include optional dependencies in the check. Either true or false. By default no optional dependencies are checked.
  • includeDirectDependencies - whether to include direct (provided) dependencies in the check. Either true or false. By default no direct provided dependencies are checked, i.e. only transitive ones are considered.

Sample Plugin Configuration:

                <requireProvidedDependenciesInRuntimeClasspath implementation="org.apache.sling.maven.enforcer.RequireProvidedDependenciesInRuntimeClasspath">