This server will be upgraded at 3pm Sydney time on December 3rd (December 2nd, 8pm PST) and will be down for up to 30 minutes.

Groovy Macro

Name Groovy Macro
Plugin Java Scripting Plugin
Description | Documentation | Common parameters | Usage | Security | Open Issues with this component

Description

Java scripting using Groovy

Documentation

  • Help available in the notation guide.

Common parameters

Pre-defined variables

Usage

{groovy}
println("Hello world");
{groovy}
{groovy:output=wiki|script=#example.py|var1=test}
{groovy} 
{groovy:var1=hello|var2=world}
print "Output parameter"
print var1 + var2
out.println(var1 + var2)
{groovy}

Security

This macro supports Macro Security Plugin.

Open Issues with this component

Labels

macro_security macro_security Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Sep 07, 2005

    Jason Dillon says:

    As noted in the Groovy docs, you need asm jars as well or just use the groovy-al...

    As noted in the Groovy docs, you need asm jars as well or just use the groovy-all-*.jar instead.

    1. Sep 07, 2005

      Bob Swift says:

      Thanks Jason. I updated the install notes above and removed my comments.

      Thanks Jason. I updated the install notes above and removed my comments.

  2. Sep 15, 2005

    Bob Swift says:

    I had a problem moving a page that used the groovy macro. Atlassian support sugg...

    I had a problem moving a page that used the groovy macro. Atlassian support suggested the following is needed in the groovy macro before they can determine if there is any problem in the base support.
    "1. The groovy macro should catch all exceptions thrown by the groovy interpreter and wrap them in a MacroException, so that they can be reported cleanly."

  3. Nov 24, 2006

    Damon Rand says:

    Get this error running groovy macros in a personal space.. Error formatting ma...

    Get this error running groovy macros in a personal space..

    Error formatting macro: groovy: java.lang.ClassFormatError: Illegal class name "~damon rand_2398" in class file ~damon rand_2398
    
    print "Output parameter"
    print var1 + var2
    out.println(var1 + var2)
    
    1. Nov 24, 2006

      Bob Swift says:

      Damon, yes, space name is used to construct class name. Need to do something di...

      Damon, yes, space name is used to construct class name. Need to do something different for personal space to get rid of the "~". Is easy to fix. Please write up an issue - use the link on the top of this page. Thanks.

  4. Sep 25

    patrice saint-louis says:

    Why doesn't this print any output on the page? {groovy:output=wiki} closure ...

    Why doesn't this print any output on the page?

    {groovy:output=wiki}
    closure = { greeting, name \-> println(greeting + name) }
    closure.call("hello ", "world\!")
    {groovy}