Repository navigation
Add the evaluateGroovy rule - #1035
Closed
slachiewicz wants to merge 1 commit into
Closed
slachiewicz wants to merge 1 commit into
slachiewicz wants to merge 1 commit into
Conversation
Groovy is the replacement engine for BeanShell across Maven (apache/maven#13207). The dependency is optional: Groovy is ~7 MB and the enforcer runs in nearly every build, so users who want the rule add org.apache.groovy:groovy to the plugin declaration and the rule reports its absence in one line.
slachiewicz
force-pushed
the
agent/evaluate-groovy
branch
from
September 20, 2026 13:52
84aaa55 to
c0fe3cf
Compare
| --- | ||
| title: Beanshell | ||
| author: | ||
| - Brian Fox |
| @@ -0,0 +1,86 @@ | |||
| --- | |||
| title: Beanshell | |||
| <version>2.0b6</version> | ||
| </dependency> | ||
| <dependency> | ||
| <!-- for evaluateGroovy; not shipped with the plugin, users add it to the plugin declaration --> |
Member
There was a problem hiding this comment.
To check if optional is not added to plugin dependencies, maybe scope provided
slawekjaranowski
approved these changes
Sep 24, 2026
Member
Author
|
Not sure if it shoudl go here. Maybe better place woudl be to mojohuse? |
Member
I'm for adding it (and other) here ... we have a lack of maintainers for mojohuse, so I hope that in ASF we have more |
Member
|
Should be done as continuation for |
Member
|
@slachiewicz why closed? ... it was ok for me |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Groovy-backed counterpart of
evaluateBeanshell, which is deprecated ahead of the BeanShell retirement (apache/maven#13207). Same shape:condition(Maven${…}interpolated first, then evaluated byGroovyShell, must yield a boolean) andmessage.Groovy is an
optionaldependency of enforcer-rules rather than a hard one: it is about 7 MB and the enforcer runs in nearly every build. Users addorg.apache.groovy:groovyto the plugin declaration (shown on the rule page); without it the rule fails with a one-line message saying exactly that. The Groovy call sits in a nested class so the rule itself loads and can report the absence.The rule page notes the one porting gotcha: BeanShell compared bare words (
${project.artifactId} == foo), Groovy needs both sides quoted. The deprecation notices onevaluateBeanshellnow point here.Verified:
TestEvaluateGroovy8/8; ITsevaluate-groovy(two rules pass),evaluate-groovy-missing(expected failure with the classpath message) andevaluate-beanshell→ Passed: 3;apache-rat:checkclean;mvn site -pl enforcer-rulesrenders the new page.