Git Product home page Git Product logo

sling-maven-enforcer-rules's Introduction

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.

Rules

Prerequisites: maven-enforcer-plugin 3.2.1 or newer

Require Provided Dependencies in Runtime Classpath (since version 1.0.0)

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).

Parameters

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>]]]. Wildcards (*) 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:

<project>
  [...]
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.3.0</version>
        <dependencies>
          <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>maven-enforcer-rules</artifactId>
            <version>LATEST</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>enforce-complete-runtime-classpath</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireProvidedDependenciesInRuntimeClasspath>
                  <excludes>
                    <exclude>javax.servlet:javax.servlet-api</exclude>
                  </excludes>
                </requireProvidedDependenciesInRuntimeClasspath>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  [...]
</project>

Require Explicit Dependency Scope (no longer available since 1.2.0)

This rule is part of maven-enforcer-plugin since version 3.2.1 (MENFORCER-423), and therefore was removed from this module.

sling-maven-enforcer-rules's People

Contributors

kwin avatar rombert avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.