Teams

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

  1. Log into Teams.

  2. Click on the Apps icon.

  3. Click on the Connectors menu item.

  4. Click on Incoming Webhook and add it to a team.

  5. Configure the webhook.

  6. 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_TEAMS_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:
  # 
  teams:
    # Enables or disables Teams.
    # 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

    # Additional properties used when evaluating templates.
    #  
    extraProperties:
      # Key will be capitalized and prefixed with `teams`, i.e, `teamsFoo`.
      foo: bar

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

    # Path to a template file that contains the message.
    # Review the available Name Templates.
    # Defaults to `src/jreleaser/templates/teams.tpl`.
    # 
    messageTemplate: path/to/template/teams.tpl
# 
[announce.teams]
  # Enables or disables Teams.
  # 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

  # Additional properties used when evaluating templates.
  #  
  extraProperties.foo = "bar"
  # Key will be capitalized and prefixed with `teams`, i.e, `teamsFoo`.

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

  # Path to a template file that contains the message.
  # Review the available Name Templates.
  # Defaults to `src/jreleaser/templates/teams.tpl`.
  # 
  messageTemplate = "path/to/template/teams.tpl"
{
  // 
  "announce": {
    // 
    "teams": {
      // Enables or disables Teams.
      // 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,

      // Additional properties used when evaluating templates.
      //  
      "extraProperties": {
        // Key will be capitalized and prefixed with `teams`, i.e, `teamsFoo`.
        "foo": "bar"
      },

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

      // Path to a template file that contains the message.
      // Review the available Name Templates.
      // Defaults to `src/jreleaser/templates/teams.tpl`.
      //  
      "messageTemplate": "path/to/template/teams.tpl"
    }
  }
}
<jreleaser>
  <!--
    
  -->
  <announce>
    <!--
      
    -->
    <teams>
      <!--
        Enables or disables Teams.
        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>

      <!--
        Additional properties used when evaluating templates.
         
      -->
      <extraProperties>
        <!--
          Key will be capitalized and prefixed with `teams`, i.e, `teamsFoo`.
        -->
        <foo>bar</foo>
      </extraProperties>

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

      <!--
        Path to a template file that contains the message.
        Review the available Name Templates.
        Defaults to `src/jreleaser/templates/teams.tpl`.
         
      -->
      <messageTemplate>path/to/template/teams.tpl</messageTemplate>
    </teams>
  </announce>
</jreleaser>
jreleaser {
  // 
  announce {
    // 
    teams {
      // Enables or disables Teams.
      // 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

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

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

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

The message must follow the Adaptive Card format.

Templates

The default location for templates is:

src/jreleaser/templates

The following list shows the filenames that may be used to override default templates:

  • teams.tpl

Templates may be initialized using the template command