[
https://jira.codehaus.org/browse/MENFORCER-164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=340001#comment-340001
]
Karl Heinz Marbaise commented on MENFORCER-164:
-----------------------------------------------
If you put the parameter searchTransitive to the correct location like:
{code}
<build>
<defaultGoal>validate</defaultGoal>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.3.1</version>
<executions>
<execution>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<bannedDependencies>
<excludes>
<exclude>commons-lang:commons-lang</exclude>
</excludes>
<searchTransitive>false</searchTransitive>
</bannedDependencies>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
{code}
It works perfectly. I have to admit the documentation could be improved to make
that more clear (MENFORCER-179). Apart from that i will the issue cause it's no
bug. If you have an other opinion don't hesitate to reopen the issue.
> bannedDependencies searchTransitive=false failure
> -------------------------------------------------
>
> Key: MENFORCER-164
> URL: https://jira.codehaus.org/browse/MENFORCER-164
> Project: Maven Enforcer Plugin
> Issue Type: Bug
> Components: Standard Rules
> Affects Versions: 1.3.1
> Reporter: jieryn
> Assignee: Karl Heinz Marbaise
> Fix For: 1.3.2
>
>
> The bannedDependencies rule is too aggressive, especially when you have
> searchTransitive=false configured. Here is an example pom.xml which
> demonstrates the problem:
> {code}
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/xsd/maven-4.0.0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <groupId>org.apache.maven.plugins.enforcer</groupId>
> <artifactId>banned-dependencies</artifactId>
> <version>1-SNAPSHOT</version>
> <dependencies>
> <dependency>
> <groupId>org.springframework.ldap</groupId>
> <artifactId>spring-ldap-core</artifactId>
> <version>1.3.2.RELEASE</version>
> </dependency>
> </dependencies>
> <build>
> <defaultGoal>validate</defaultGoal>
> <plugins>
> <plugin>
> <artifactId>maven-enforcer-plugin</artifactId>
> <version>1.3.1</version>
> <executions>
> <execution>
> <goals>
> <goal>enforce</goal>
> </goals>
> <configuration>
> <rules>
> <bannedDependencies>
> <excludes>
> <exclude>commons-lang:commons-lang</exclude>
> </excludes>
> </bannedDependencies>
> </rules>
> <searchTransitive>false</searchTransitive>
> </configuration>
> </execution>
> </executions>
> </plugin>
> </plugins>
> </build>
> </project>
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira