1and1 / ono-extra-enforcer-rules

Apache License 2.0
4 stars 0 forks source link

ono-extra-enforcer-rules

Latest Travis-Build: Build Status

Rules

<ForbidOverridingManagedDependenciesRule />

Forbids overriding dependency management of parent.

<ForbidOverridingManagedPluginsRule />

Forbids overriding plugin management of parent.

<ForbidDependencyManagementInSubModulesRule />

Forbids dependency management in submodules.

<excludes>
    <exclude>javax.validation:validation-api</exclude>
</excludes>

The rules above can define excludes. The check is a simple startsWith on $groupId:$artifactId

<ManageAllModulesRule />

Checks if all submodules of a multimodule are defined in dependency management.

Example

<build>
    <plugins>
        <plugin>
            <artifactId>maven-enforcer-plugin</artifactId>
            <dependencies>
                <dependency>
                    <groupId>net.oneandone.maven</groupId>
                    <artifactId>ono-extra-enforcer-rules</artifactId>
                    <version>${project.version}</version>
                </dependency>
            </dependencies>
            <configuration>
                <rules>
                    <ForbidOverridingManagedDependenciesRule>
                            <excludes>
                                <!-- guava in parent is too old, so allow to override it -->
                                <exclude>com.google.guava:guava</exclude>
                            </excludes>
                    </ForbidOverridingManagedDependenciesRule>
                    <ForbidOverridingManagedPluginsRule />
                    <ForbidDependencyManagementInSubModulesRule />
                    <ManageAllModulesRule />
                </rules>
            </configuration>
        </plugin>
    </plugins>
</build>