Gitter

Posts a message to a Gitter room. You must create a custom webhook for this announcer to work.

  1. Log into Gitter.

  2. Browse to the room you want to integrate to.

  3. Click on the Settings menu and select Integrations.

  4. Click on the CUSTOM button.

  5. Copy the generated webhook URL.

Webhooks are not protected, anyone with access to the webhook URI can send messages to the target room. Prefer setting the JRELEASER_GITTER_WEBHOOK environment variable over explicitly setting a value in the configuration DSL.

Legend:

  • required

  • optional

  • may use environment variable

  • accepts Name Templates

  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

announce:
  # 
  gitter:

    # Enable or disable this announcer.
    # Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
    # Defaults to `NEVER`.
    # 
    active: ALWAYS

    # Defines the connection timeout in seconds.
    # Defaults to `20`.
    # 
    connectTimeout: 20

    # Defines the read timeout in seconds.
    # Defaults to `60`.
    # 
    readTimeout: 6

    # The webhook associated with a specific Gitter room.
    # If left unspecified, the `JRELEASER_GITTER_WEBHOOK`
    # environment variable must be defined.
    #  
    webhook: __DO_NOT_SET_HERE__

    # The announcement message.
    # Review the available Name Templates.
    #  
    message: ' {{projectNameCapitalized}} {{projectVersion}} has been released! {{releaseNotesUrl}}'

    # Path to a template file that contains the message.
    # Review the available Name Templates.
    # Defaults to `src/jreleaser/templates/gitter.tpl`.
    # 
    messageTemplate: path/to/template/gitter.tpl

    # Additional properties used when evaluating templates.
    #  
    extraProperties:
      # Key will be capitalized and prefixed with `gitter`, i.e, `gitterFoo`.
      foo: bar
# 
[announce.gitter]

  # Enable or disable this announcer.
  # Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
  # Defaults to `NEVER`.
  # 
  active = "ALWAYS"

  # Defines the connection timeout in seconds.
  # Defaults to `20`.
  # 
  connectTimeout = 20

  # Defines the read timeout in seconds.
  # Defaults to `60`.
  # 
  readTimeout = 60

  # The webhook associated with a specific Gitter room.
  # If left unspecified, the `JRELEASER_GITTER_WEBHOOK`
  # environment variable must be defined.
  #  
  webhook = "__DO_NOT_SET_HERE__"

  # The announcement message.
  # Review the available Name Templates.
  #  
  message = " {{projectNameCapitalized}} {{projectVersion}} has been released! {{releaseNotesUrl}}"

  # Path to a template file that contains the message.
  # Review the available Name Templates.
  # Defaults to `src/jreleaser/templates/gitter.tpl`.
  # 
  messageTemplate = "path/to/template/gitter.tpl"

  # Additional properties used when evaluating templates.
  #  
  extraProperties.foo = "bar"
  # Key will be capitalized and prefixed with `gitter`, i.e, `gitterFoo`.
{
  "announce": {
    // 
    "gitter": {

      // Enable or disable this announcer.
      // Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
      // Defaults to `NEVER`.
      // 
      "active": "ALWAYS",

      // Defines the connection timeout in seconds.
      // Defaults to `20`.
      // 
      "connectTimeout": 20,

      // Defines the read timeout in seconds.
      // Defaults to `60`.
      // 
      "readTimeout": 60,

      // The webhook associated with a specific Gitter room.
      // If left unspecified, the `JRELEASER_GITTER_WEBHOOK`
      // environment variable must be defined.
      //  
      "webhook": "__DO_NOT_SET_HERE__",

      // The announcement message.
      // Review the available Name Templates.
      //  
      "message": " {{projectNameCapitalized}} {{projectVersion}} has been released! {{releaseNotesUrl}}",

      // Path to a template file that contains the message.
      // Review the available Name Templates.
      // Defaults to `src/jreleaser/templates/gitter.tpl`.
      // 
      "messageTemplate": "path/to/template/gitter.tpl",

      // Additional properties used when evaluating templates.
      //  
      "extraProperties": {
        // Key will be capitalized and prefixed with `gitter`, i.e, `gitterFoo`.
        "foo": "bar"
      }
    }
  }
}
<jreleaser>
  <!--
    
  -->
  <announce>
    <!--
      
    -->
    <gitter>

      <!--
        Enable or disable this announcer.
        Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
        Defaults to `NEVER`.
        
      -->
      <active>ALWAYS</active>

      <!--
        Defines the connection timeout in seconds.
        Defaults to `20`.
        
      -->
      <connectTimeout>20</connectTimeout>

      <!--
        Defines the read timeout in seconds.
        Defaults to `60`.
        
      -->
      <readTimeout>60</readTimeout>

      <!--
        The webhook associated with a specific Gitter room.
        If left unspecified, the `JRELEASER_GITTER_WEBHOOK` environment variable must be defined.
         
      -->
      <webhook>__DO_NOT_SET_HERE__</webhook>

      <!--
        The announcement message.
        Review the available Name Templates.
         
      -->
      <message> {{projectNameCapitalized}} {{projectVersion}} has been released! {{releaseNotesUrl}}</message>

      <!--
        Path to a template file that contains the message.
        Review the available Name Templates.
        Defaults to `src/jreleaser/templates/gitter.tpl`.
        
      -->
      <messageTemplate>path/to/template/gitter.tpl</messageTemplate>

      <!--
        Additional properties used when evaluating templates.
         
      -->
      <extraProperties>
        <!--
          Key will be capitalized and prefixed with `gitter`, i.e, `gitterFoo`.
        -->
        <foo>bar</foo>
      </extraProperties>
    </gitter>
  </announce>
</jreleaser>
jreleaser {
  announce {
    // 
    gitter {

      // Enable or disable this announcer.
      // Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
      // Defaults to `NEVER`.
      // 
      active = 'ALWAYS'

      // Defines the connection timeout in seconds.
      // Defaults to `20`.
      // 
      connectTimeout = 20

      // Defines the read timeout in seconds.
      // Defaults to `60`.
      // 
      readTimeout = 60

      // The webhook associated with a specific Gitter room.
      // If left unspecified, the `JRELEASER_GITTER_WEBHOOK`
      // environment variable must be defined.
      //  
      webhook = '__DO_NOT_SET_HERE__'

      // The announcement message.
      // Review the available Name Templates.
      //  
      message = ' {{projectNameCapitalized}} {{projectVersion}} has been released! {{releaseNotesUrl}}'

      // Path to a template file that contains the message.
      // Review the available Name Templates.
      // Defaults to `src/jreleaser/templates/gitter.tpl`.
      // 
      messageTemplate = 'path/to/template/gitter.tpl'

      // Additional properties used when evaluating templates.
      // Key will be capitalized and prefixed with `gitter`, i.e, `gitterFoo`.
      //  
      extraProperties.put('foo', 'bar')
    }
  }
}

You may define either message or messageTemplate, with the former taking precedence over the latter.

The template file may be initialized using the template command.