~~ Licensed to the Apache Software Foundation (ASF) under one ~~ or more contributor license agreements. See the NOTICE file ~~ distributed with this work for additional information ~~ regarding copyright ownership. The ASF licenses this file ~~ to you under the Apache License, Version 2.0 (the ~~ "License"); you may not use this file except in compliance ~~ with the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, ~~ software distributed under the License is distributed on an ~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ~~ KIND, either express or implied. See the License for the ~~ specific language governing permissions and limitations ~~ under the License. ------ Banned Dependencies ------ Brian Fox ------ November 2007 ------ Banned Dependencies This rule checks the dependencies and fails if any of the matching excludes are found. The following parameters are supported by this rule: * searchTransitive - if transitive dependencies should be checked. * excludes - a list of artifacts to ban. The format is groupId[:artifactId][:version][:type][:scope] where artifactId, version, type, and scope are optional. Wildcards may be used to replace an entire section. Examples: * org.apache.maven * org.apache.maven:badArtifact * org.apache.maven:artifact:badVersion * org.apache.maven:*:1.2 * org.apache.maven:*:*:jar:test [] * includes - a list of artifacts to include. These are exceptions to the excludes. It is meant to allow wide exclusion rules with wildcards and fine tune using includes. If nothing has been excluded, then the includes have no effect. In otherwords, includes only subtract from artifacts that matched an exclude rule. For example, to ban all xerces except xerces-api you would exclude "xerces" (groupId) and include "xerces:xerces-api" * message - an optional message to the user if the rule fails. [] Sample Plugin Configuration: +---+ [...] org.apache.maven.plugins maven-enforcer-plugin ${project.version} enforce-banned-dependencies enforce org.apache.maven org.apache.maven:badArtifact *:badArtifact org.apache.maven:badArtifact:1.0 true [...] +---+