You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Andrew Lee Rubinger (JIRA)" <ji...@codehaus.org> on 2010/02/10 18:57:55 UTC
[jira] Created: (MENFORCER-90) Allow "BannedDependencies" to
restrict artifacts per-scope
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
[jira] Issue Comment Edited: (MENFORCER-90) Allow
"BannedDependencies" to restrict artifacts per-scope
Posted by "Donnie Armstrong (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MENFORCER-90?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=210088#action_210088 ]
Donnie Armstrong edited comment on MENFORCER-90 at 2/13/10 6:31 PM:
--------------------------------------------------------------------
Perhaps base the format off the output of dependency:tree?
For example,
{noformat}
com.noelios.restlet:com.noelios.restlet.ext.spring:jar:1.1.5:compile
+- com.noelios.restlet:com.noelios.restlet.ext.servlet:jar:1.1.5:compile
+- org.springframework:spring-core:jar:2.5.6:compile
+- org.springframework:spring-context:jar:2.5.6:compile
| \- aopalliance:aopalliance:jar:1.0:compile
+- org.springframework:spring-beans:jar:2.5.6:compile
+- org.springframework:spring-web:jar:2.5.6:compile
\- org.springframework:spring-webmvc:jar:2.5.6:compile
\- org.springframework:spring-context-support:jar:2.5.6:compile
{noformat}
Therefore we might use the format of exclude/include as:
{noformat}groupId:artifactId:type:version:scope{noformat}
The following would permitted
{noformat}<exclude>com.noelios.restlet:*:*:*:provided</exclude>{noformat}
whereas this would be banned
{noformat}<exclude>com.noelios.restlet:*:*:*:compile</exclude>{noformat}
Another alternative might be to create a new exclude/include object that called out the artifact components instead of a string pattern.
{noformat}
<exclude>
<groupId />
<artifactId />
<type />
<version />
<scope />
</exclude>
{noformat}
was (Author: donnie_armstrong):
Perhaps base the format off the output of dependency:tree?
For example,
com.noelios.restlet:com.noelios.restlet.ext.spring:jar:1.1.5:compile
+- com.noelios.restlet:com.noelios.restlet.ext.servlet:jar:1.1.5:compile
+- org.springframework:spring-core:jar:2.5.6:compile
+- org.springframework:spring-context:jar:2.5.6:compile
| \- aopalliance:aopalliance:jar:1.0:compile
+- org.springframework:spring-beans:jar:2.5.6:compile
+- org.springframework:spring-web:jar:2.5.6:compile
\- org.springframework:spring-webmvc:jar:2.5.6:compile
\- org.springframework:spring-context-support:jar:2.5.6:compile
Therefore we might use the format of exclude/include as:
groupId:artifactId:type:version:scope
The following would permitted
<exclude>com.noelios.restlet:*:*:*:provided</exclude>
whereas this would be banned
<exclude>com.noelios.restlet:*:*:*:compile</exclude>
- or -
create a new exclude/include object that called out the components instead of a string pattern. *hug* xml
<exclude>
<groupId />
<artifactId />
<type />
<version />
<scope />
</exclude>
> 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
[jira] Commented: (MENFORCER-90) Allow "BannedDependencies" to
restrict artifacts per-scope
Posted by "Raphael Ackermann (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MENFORCER-90?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=227703#action_227703 ]
Raphael Ackermann commented on MENFORCER-90:
--------------------------------------------
isn't that the same as http://jira.codehaus.org/browse/MENFORCER-72 ?
> 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
[jira] Commented: (MENFORCER-90) Allow "BannedDependencies" to
restrict artifacts per-scope
Posted by "Donnie Armstrong (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MENFORCER-90?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=210088#action_210088 ]
Donnie Armstrong commented on MENFORCER-90:
-------------------------------------------
Perhaps base the format off the output of dependency:tree?
For example,
com.noelios.restlet:com.noelios.restlet.ext.spring:jar:1.1.5:compile
+- com.noelios.restlet:com.noelios.restlet.ext.servlet:jar:1.1.5:compile
+- org.springframework:spring-core:jar:2.5.6:compile
+- org.springframework:spring-context:jar:2.5.6:compile
| \- aopalliance:aopalliance:jar:1.0:compile
+- org.springframework:spring-beans:jar:2.5.6:compile
+- org.springframework:spring-web:jar:2.5.6:compile
\- org.springframework:spring-webmvc:jar:2.5.6:compile
\- org.springframework:spring-context-support:jar:2.5.6:compile
Therefore we might use the format of exclude/include as:
groupId:artifactId:type:version:scope
The following would permitted
<exclude>com.noelios.restlet:*:*:*:provided</exclude>
whereas this would be banned
<exclude>com.noelios.restlet:*:*:*:compile</exclude>
- or -
create a new exclude/include object that called out the components instead of a string pattern. *hug* xml
<exclude>
<groupId />
<artifactId />
<type />
<version />
<scope />
</exclude>
> 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
[jira] Closed: (MENFORCER-90) Allow "BannedDependencies" to
restrict artifacts per-scope
Posted by "Paul Gier (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MENFORCER-90?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul Gier closed MENFORCER-90.
------------------------------
Resolution: Duplicate
> 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
[jira] Commented: (MENFORCER-90) Allow "BannedDependencies" to
restrict artifacts per-scope
Posted by "Andrew Lee Rubinger (JIRA)" <ji...@codehaus.org>.
[ 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