Linkedin

Shares a post to Linkedin. You must obtain an Oauth access token with the following permissions:

  • r_emailaddress,

  • r_liteprofile,

  • w_member_social

Configuration

Legend:

  • required

  • optional

  • may use environment variable

  • accepts Name Templates

  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

# 
announce:
  # 
  linkedin:
    # Enables or disables Linkedin.
    # Supported 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 `linkedin`, i.e, `linkedinFoo`.
      foo: bar

    # The OAuth access token.
    #  
    token: __USE_ENVIRONMENT_VARIABLE__

    # The URN identifying the actor that can post a share.
    #  
    owner: __USE_ENVIRONMENT_VARIABLE__

    # The post subject.
    # Review the available Name Templates.
    #  
    subject: '{{projectNameCapitalized}} {{projectVersion}} released'

    # 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/linkedin.tpl`.
    # 
    messageTemplate: path/to/template/linkedin.tpl
# 
[announce.linkedin]
  # Enables or disables Linkedin.
  # Supported 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 `linkedin`, i.e, `linkedinFoo`.

  # The OAuth access token.
  #  
  token = "__USE_ENVIRONMENT_VARIABLE__"

  # The URN identifying the actor that can post a share.
  #  
  owner = "__USE_ENVIRONMENT_VARIABLE__"

  # The post subject.
  # Review the available Name Templates.
  #  
  subject = "{{projectNameCapitalized}} {{projectVersion}} released"

  # 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/linkedin.tpl`.
  # 
  messageTemplate = "path/to/template/linkedin.tpl"
{
  // 
  "announce": {
    // 
    "linkedin": {
      // Enables or disables Linkedin.
      // Supported 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 `linkedin`, i.e, `linkedinFoo`.
        "foo": "bar"
      },

      // The OAuth access token.
      //  
      "token": "__USE_ENVIRONMENT_VARIABLE__",

      // The URN identifying the actor that can post a share.
      //  
      "owner": "__USE_ENVIRONMENT_VARIABLE__",

      // The post subject.
      // Review the available Name Templates.
      //  
      "subject": "{{projectNameCapitalized}} {{projectVersion}} released"

      // 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/linkedin.tpl`.
      // 
      "messageTemplate": "path/to/template/linkedin.tpl"
    }
  }
}
<jreleaser>
  <!--
    
  -->
  <announce>
    <!--
      
    -->
    <linkedin>
      <!--
        Enables or disables Linkedin.
        Supported 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 `linkedin`, i.e, `linkedinFoo`.
        -->
        <foo>bar</foo>
      </extraProperties>

      <!--
        The OAuth access token.
         
      -->
      <token>__USE_ENVIRONMENT_VARIABLE__</token>

      <!--
        The URN identifying the actor that can post a share.
         
      -->
      <owner>__USE_ENVIRONMENT_VARIABLE__</owner>

      <!--
        The post subject.
        Review the available Name Templates.
         
      -->
      <subject>{{projectNameCapitalized}} {{projectVersion}} released</subject>

      <!--
        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/linkedin.tpl`.
        
      -->
      <messageTemplate>path/to/template/linkedin.tpl</messageTemplate>
    </linkedin>
  </announce>
</jreleaser>
jreleaser {
  // 
  announce {
    // 
    linkedin {
      // Enables or disables Linkedin.
      // Supported 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 `linkedin`, i.e, `linkedinFoo`.
      //  
      extraProperties.put('foo', 'bar')

      // The OAuth access token.
      //  
      token = '__USE_ENVIRONMENT_VARIABLE__'

      // The URN identifying the actor that can post a share.
      //  
      owner = '__USE_ENVIRONMENT_VARIABLE__'

      // The post subject.
      // Review the available Name Templates.
      //  
      subject = '{{projectNameCapitalized}} {{projectVersion}} released'

      // 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/linkedin.tpl`.
      // 
      messageTemplate = 'path/to/template/linkedin.tpl'
    }
  }
}

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

Use messageTemplate to define a custom JSON payload.

Environment

When not explicitly set, the value of the following properties may be resolved from an environment variable or a system property as shown in the table. The system property takes precedence over the environment variable.

System Property Environment Variable

active

jreleaser.announce.linkedin.active

JRELEASER_ANNOUNCE_LINKEDIN_ACTIVE

token

jreleaser.announce.linkedin.access.token
jreleaser.linkedin.access.token

JRELEASER_ANNOUNCE_LINKEDIN_ACCESS_TOKEN
JRELEASER_LINKEDIN_ACCESS_TOKEN

owner

jreleaser.announce.linkedin.owner
jreleaser.linkedin.owner

JRELEASER_ANNOUNCE_LINKEDIN_OWNER
JRELEASER_LINKEDIN_OWNER

Templates

The default location for templates is:

src/jreleaser/templates

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

  • linkedin.tpl

Templates may be initialized using the template command