summaryrefslogtreecommitdiff
path: root/doc/note/maven-pom/howto-ban-unwanted-sh__.txt
blob: 1edad9b0051f46411895c17d86137ec99b0e70ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41


  <project>
    <dependencies>
      <dependency>
         <groupId>org.apache.logging.log4j</groupId>
         <artifactId>log4j-slf4j-impl</artifactId>
         <version>[0.0.0,)</version>
         <scope>provided</scope>
      </dependency>
    </dependencies>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <!--<version>1.4.1</version>-->
        <version>3.4.1</version>
        <executions>
          <execution>
            <goals><goal>enforce</goal></goals>
            <configuration>
              <rules>
                <bannedDependencies>
                  <excludes>
                    <exclude>org.apache.logging.log4j:log4j-slf4j-impl</exclude>
                  </excludes>
                </bannedDependencies>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  <project>


## Sources

- [How to globally exclude mvn dependency](https://stackoverflow.com/a/39979760/4415884)
- [How to yell about bannded dependencies](https://stackoverflow.com/a/46104531/4415884)