Groovy Macro
Last modified by Admin on 2026/09/08 00:00
| Adds ability to write scripts in Groovy in wiki pages |
| Type | JAR |
| Category | |
| Developed by | |
| Active Installs | 4 |
| Rating | |
| License | GNU Lesser General Public License 2.1 |
| Bundled With | XWiki Standard |
Table of contents
Description
This is a shortcut for Script Macro equivalent to {{script language="groovy"}} to execute groovy scripts.
Usage
{{groovy}}
def list = ["one", "two"]
list.each { item ->
println "* ${item}"
}
{{/groovy}}Parameters definition
If Groovy script is not supposed to produce any output, for example, Groovy Class with just parameters is defined, declare macro as:
{{groovy output="false"}}See Script Macro for details.
Example
{{groovy}}
def list = ["one", "two"]
list.each { item ->
println "* ${item}"
}
{{/groovy}}Result
- one
- two
Dependencies
Dependencies for this extension (org.xwiki.platform:xwiki-platform-rendering-macro-groovy ):
- org.xwiki.platform:xwiki-platform-groovy 18.7.0
- org.xwiki.platform:xwiki-platform-rendering-macro-script 18.7.0
- org.xwiki.rendering:xwiki-rendering-api 18.7.0
- org.xwiki.rendering:xwiki-rendering-transformation-macro 18.7.0