[ 
http://jira.codehaus.org/browse/MENFORCER-90?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=209679#action_209679
 ] 

Andrew Lee Rubinger commented on MENFORCER-90:
----------------------------------------------

Perhaps the new configuration syntax would be:

<includes></includes>
<includes></includes>
<scopes>
  <scope>compile</scope>
  <scope>provided</scope>
</scopes>

...or <scopes> could accept comma-delimited Strings directly..

Then each BannedDependency rule definition would declare all artifacts banned 
for a particular scope, and you could define many rules if needed.

> Allow "BannedDependencies" to restrict artifacts per-scope
> ----------------------------------------------------------
>
>                 Key: MENFORCER-90
>                 URL: http://jira.codehaus.org/browse/MENFORCER-90
>             Project: Maven 2.x Enforcer Plugin
>          Issue Type: Improvement
>          Components: Standard Rules
>            Reporter: Andrew Lee Rubinger
>
> The current BannedDependencies plugin allows the restriction of any artifact 
> by groupId, artifactId, etc.  We've observed cases where we need to block 
> only in certain scopes, for instance:
> * I have a component which uses some logging backend
> * I don't want to allow any code to directly use the logging backend; it 
> should use an abstraction SPI
> * I want to bar all logging backends from the compilation classpath, but they 
> must be available at runtime for tests
> * So I'd set a banned dependency upon the logging backend for scopes 
> "compile" and "provided", permitting its use in testing
> I've mocked this (with hardcoded banned scopes) by copying from the existing 
> BannedDependency stuff:
> http://anonsvn.jboss.org/repos/sandbox/alrubinger/maven-enforcer-rule-nocompiledep/trunk/nocompiledep/src/main/java/org/jboss/maven/plugins/enforcer/rules/nocompiledep/NoCompileDependencyRule.java
> ...which works pretty well, but it'd be nice to have this
> 1) Configurable
> 2) Upstream

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to