~ubuntu-branches/ubuntu/utopic/maven-enforcer/utopic

« back to all changes in this revision

Viewing changes to enforcer-rules/src/site/apt/bannedDependencies.apt

  • Committer: Package Import Robot
  • Author(s): Torsten Werner
  • Date: 2011-09-12 22:30:16 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: package-import@ubuntu.com-20110912223016-e2pk04avoq8bur7t
Tags: 1.0-1
* Team upload
* New upstream release.
* Add more Build-Depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
~~ Licensed to the Apache Software Foundation (ASF) under one
2
 
~~ or more contributor license agreements.  See the NOTICE file
3
 
~~ distributed with this work for additional information
4
 
~~ regarding copyright ownership.  The ASF licenses this file
5
 
~~ to you under the Apache License, Version 2.0 (the
6
 
~~ "License"); you may not use this file except in compliance
7
 
~~ with the License.  You may obtain a copy of the License at
8
 
~~
9
 
~~ http://www.apache.org/licenses/LICENSE-2.0
10
 
~~
11
 
~~ Unless required by applicable law or agreed to in writing,
12
 
~~ software distributed under the License is distributed on an
13
 
~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
 
~~ KIND, either express or implied.  See the License for the
15
 
~~ specific language governing permissions and limitations
16
 
~~ under the License.    
17
 
 
18
 
  ------
19
 
  Banned Dependencies
20
 
  ------
21
 
  Brian Fox
22
 
  ------
23
 
  November 2007
24
 
  ------
25
 
 
26
 
Banned Dependencies
27
 
 
28
 
  This rule checks the dependencies and fails if any of the matching excludes are found.
29
 
 
30
 
 
31
 
   The following parameters are supported by this rule:
32
 
   
33
 
   * searchTransitive - if transitive dependencies should be checked.
34
 
   
35
 
   * excludes - a list of artifacts to ban. The format is groupId[:artifactId][:version] where artifactId and version are optional. Wildcards may be used to replace an entire section.
36
 
      Examples:
37
 
       
38
 
        * org.apache.maven
39
 
        
40
 
        * org.apache.maven:badArtifact
41
 
        
42
 
        * org.apache.maven:artifact:badVersion
43
 
        
44
 
        * org.apache.maven:*:1.2
45
 
        
46
 
        []
47
 
 
48
 
   * 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.
49
 
   
50
 
   For example, to ban all xerces except xerces-api you would exclude "xerces" (groupId) and include "xerces:xerces-api"   
51
 
   
52
 
   * message - an optional message to the user if the rule fails.
53
 
   
54
 
   []
55
 
 
56
 
   
57
 
  Sample Plugin Configuration:
58
 
  
59
 
+---+
60
 
<project>
61
 
  [...]
62
 
  <build>
63
 
    <plugins>
64
 
      <plugin>
65
 
        <groupId>org.apache.maven.plugins</groupId>
66
 
        <artifactId>maven-enforcer-plugin</artifactId>
67
 
        <version>1.0</version>
68
 
        <executions>
69
 
          <execution>
70
 
            <id>enforce-banned-dependencies</id>
71
 
            <goals>
72
 
              <goal>enforce</goal>
73
 
            </goals>
74
 
            <configuration>
75
 
              <rules>
76
 
                <bannedDependencies>
77
 
                  <excludes>
78
 
                    <exclude>org.apache.maven</exclude>
79
 
                    <exclude>org.apache.maven:badArtifact</exclude>
80
 
                    <exclude>*:badArtifact</exclude>
81
 
                  </excludes>
82
 
                  <includes>
83
 
                    <!--only 1.0 of badArtifact is allowed-->
84
 
                    <include>org.apache.maven:badArtifact:1.0</include>
85
 
                  </includes>
86
 
                </bannedDependencies>
87
 
              </rules>
88
 
              <fail>true</fail>
89
 
            </configuration>
90
 
          </execution>
91
 
        </executions>
92
 
      </plugin>
93
 
    </plugins>
94
 
  </build>
95
 
  [...]
96
 
</project>
97
 
+---+
 
 
b'\\ No newline at end of file'