Snap

Snaps are a new packaging format, that will let you publish your project directly to the Ubuntu store. From there it will be installable in all the supported Linux distros, with automatic and transactional updates.

You can read more about it in the snapcraft docs.

Only artifacts with .tar.gz, .tar, or .jar extension may be packaged with Snapcraft.
Snapshots are not supported.
Building local snaps requires snapcraft to be pre installed. JReleaser will not install it nor its dependencies.

Legend:

  • required

  • optional

  • may use environment variable

  • accepts Name Templates

  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

# 
packagers:
  # 
  snap:
    # Enables or disables Snap.
    # Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
    # Defaults to `NEVER`.
    # 
    active: ALWAYS

    # Let the release continue if the packager fails.
    # Defaults to `false`.
    # 
    continueOnError: true

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

    # Directory with file templates used to prepare the Snap distribution.
    # Defaults to `src/jreleaser/distributions/${distribution.name}/snap`.
    # If specified, path must exist.
    # 
    templateDirectory: path/to/snap/templates

    # Git author used to commit to the repository.
    # 
    commitAuthor:
      # Name used when authoring commits.
      # Defaults to `jreleaserbot`.
      # 
      name: jreleaserbot

      # E-mail used when authoring commits.
      # Defaults to `jreleaser@kordamp.org`.
      # 
      email: jreleaser@kordamp.org

    # Git repository to push the manifest to.
    # Defaults are shown.
    # 
    snap:

      # The owner of the snap repository.
      # Defaults to the same owner as the release repository.
      # 
      owner: duke

      # The name of the snap repository.
      # Defaults to `app-snap`.
      # 
      name: app-snap

      # The target branch to use.
      # May define a `JRELEASER_SNAP_${GIT}_BRANCH` environment variable instead.
      # Defaults to the branch pointed by HEAD.
      #  
      branch: HEAD

      # Username used for authoring commits. Must have write access to the snap repository.
      # If left unspecified, the `JRELEASER_SNAP_${GIT}_USERNAME`
      # environment variable must be defined.
      # Defaults to the same username as the release repository.
      #  
      username: duke

      # Password or OAuth token with write access to the snap repository.
      # If left unspecified, the `JRELEASER_SNAP_${GIT}_TOKEN`
      # environment variable must be defined.
      #  
      token: __DO_NOT_SET_HERE__

    # Exported snapcraft login credentials.
    # Will be sent to local snapcraft build with `snapcraft login --with ${exportedLogin}`.
    # Required if `remoteBuild` is set to `false`.
    exportedLogin: path/to/login/file

    # Whether to build the package on a remote server or locally.
    # If set to `true` then the package must be configured to be built
    # via https://snapcraft.io.
    # Review the docs at https://snapcraft.io/build.
    # Defaults to `false`.
    # 
    remoteBuild: false

    # A snap of type base to be used as the execution environment for this snap.
    # Valid values are:
    # * bare - Empty base snap;
    # * core - Ubuntu Core 16;
    # * core20 - Ubuntu Core 20.
    # Defaults to `core20`.
    # 
    base: core20

    # A guardrail to prevent you from releasing a snap to all your users before
    # it is ready.
    # `devel` will let you release only to the `edge` and `beta` channels in the
    # store. `stable` will let you release also to the `candidate` and `stable`
    # channels. More info about channels here:
    # https://snapcraft.io/docs/reference/channels.
    # Defaults to `stable`.
    # 
    grade: stable

    # Snaps can be setup to follow three different confinement policies:
    # `strict`, `devmode` and `classic`. A strict confinement where the snap
    # can only read and write in its own namespace is recommended. Extra
    # permissions for strict snaps can be declared as `plugs` for the app, which
    # are explained later. More info about confinement here:
    # https://snapcraft.io/docs/reference/confinement.
    # Defaults to `strict`.
    # 
    confinement: strict

    # List of plug names the application is associated with.
    # When a plug is connected to one of these slots, the application
    # will be granted the permissions specified for that interface.
    # If attributes are required, or the plug name does not match the
    # interface name, more details must be declared in the `plugs` field.
    # https://snapcraft.io/docs/reference/interfaces.
    # 
    localPlugs:
      - some_plug_name

    # List of slot names the application is associated with.
    # When a plug is connected to one of these slots, the application
    # will be granted the permissions specified for that interface.
    # If attributes are required, or the slot name does not match the
    # interface name, more details must be declared in the `slots` field.
    # https://snapcraft.io/docs/reference/interfaces.
    # 
    localSlots:
      - some_slot_name

    # Allows plugs to be configured.
    # 
    plugs:
      some_plug_name:
        key: value

    # Allows slots to be configured.
    # 
    slots:
      some_slot_name:
        key: value
        read:
        - $HOME/.foo
        write:
        - $HOME/.foo
        - $HOME/.foobar
# 
[packagers.snap]
  # Enables or disables Snap.
  # Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
  # Defaults to `NEVER`.
  # 
  active = "ALWAYS"

  # Let the release continue if the packager fails.
  # Defaults to `false`.
  # 
  continueOnError = true

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

  # Directory with file templates used to prepare the Snap distribution.
  # Defaults to `src/jreleaser/distributions/${distribution.name}/snap`.
  # If specified, path must exist.
  # 
  templateDirectory = "path/to/snap/templates"

  # Git author used to commit to the repository.

  # Name used when authoring commits.
  # Defaults to `jreleaserbot`.
  # 
  commitAuthor.name = "jreleaserbot"

  # E-mail used when authoring commits.
  # Defaults to `jreleaser@kordamp.org`.
  # 
  commitAuthor.email = "jreleaser@kordamp.org"

  # Git repository to push the manifest to.
  # Defaults are shown.

  # The owner of the snap repository.
  # Defaults to the same owner as the release repository.
  # 
  snap.owner = "duke"

  # The name of the snap repository.
  # Defaults to `app-snap`.
  # 
  snap.name = "app-snap"

  # The target branch to use.
  # May define a `JRELEASER_SNAP_${GIT}_BRANCH` environment variable instead.
  # Defaults to the branch pointed by HEAD.
  #  
  snap.branch = "HEAD"

  # Username used for authoring commits. Must have write access to the snap repository.
  # If left unspecified, the `JRELEASER_SNAP_${GIT}_USERNAME`
  # environment variable must be defined.
  # Defaults to the same username as the release repository.
  #  
  snap.username = "duke"

  # Password or OAuth token with write access to the snap repository.
  # If left unspecified, the `JRELEASER_SNAP_${GIT}_TOKEN`
  # environment variable must be defined.
  #  
  snap.token = "__DO_NOT_SET_HERE__"

  # Exported snapcraft login credentials.
  # Will be sent to local snapcraft build with `snapcraft login --with ${exportedLogin}`.
  # Required if `remoteBuild` is set to `false`.
  exportedLogin = "path/to/login/file"

  # Whether to build the package on a remote server or locally.
  # If set to `true` then the package must be configured to be built
  # via https://snapcraft.io.
  # Review the docs at https://snapcraft.io/build.
  # Defaults to `false`.
  # 
  remoteBuild = false

  # A snap of type base to be used as the execution environment for this snap.
  # Valid values are:
  # * bare - Empty base snap;
  # * core - Ubuntu Core 16;
  # * core20 - Ubuntu Core 20.
  # Defaults to `core20`.
  # 
  base = "core20"

  # A guardrail to prevent you from releasing a snap to all your users before
  # it is ready.
  # `devel` will let you release only to the `edge` and `beta` channels in the
  # store. `stable` will let you release also to the `candidate` and `stable`
  # channels. More info about channels here:
  # https://snapcraft.io/docs/reference/channels.
  # Defaults to `stable`.
  # 
  grade = "stable"

  # Snaps can be setup to follow three different confinement policies:
  # `strict`, `devmode` and `classic`. A strict confinement where the snap
  # can only read and write in its own namespace is recommended. Extra
  # permissions for strict snaps can be declared as `plugs` for the app, which
  # are explained later. More info about confinement here:
  # https://snapcraft.io/docs/reference/confinement.
  # Defaults to `strict`.
  # 
  confinement = "strict"

  # List of plug names the application is associated with.
  # When a plug is connected to one of these slots, the application
  # will be granted the permissions specified for that interface.
  # If attributes are required, or the plug name does not match the
  # interface name, more details must be declared in the `plugs` field.
  # https://snapcraft.io/docs/reference/interfaces.
  # 
  localPlugs = ["some_plug_name"]

  # List of slot names the application is associated with.
  # When a plug is connected to one of these slots, the application
  # will be granted the permissions specified for that interface.
  # If attributes are required, or the slot name does not match the
  # interface name, more details must be declared in the `slots` field.
  # https://snapcraft.io/docs/reference/interfaces.
  # 
  localSlots = ["some_slot_name"]

  # Allows plugs to be configured.
  # 
  [packagers.snap.plugs]
    some_plug_name.key = "value"

  # Allows slots to be configured.
  # 
  [packagers.snap.slots]
    some_slot_name.key = "value"
    some_slot_name.read = ["$HOME/.foo"]
    some_slot_name.write = ["$HOME/.foo", "$HOME/.foobar"]
{
  // 
  "packagers": {
    // 
    "snap": {
      // Enables or disables Snap.
      // Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
      // Defaults to `NEVER`.
      // 
      "active": "ALWAYS",

      // Let the release continue if the packager fails.
      // Defaults to `false`.
      // 
      "continueOnError": true,

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

      // Directory with file templates used to prepare the Snap distribution.
      // Defaults to `src/jreleaser/distributions/${distribution.name}/snap`.
      // If specified, path must exist.
      // 
      "templateDirectory": "path/to/snap/templates",

      // Git author used to commit to the repository.
      // 
      "commitAuthor": {
        // Name used when authoring commits.
        // Defaults to `jreleaserbot`.
        // 
        "name": "jreleaserbot",

        // E-mail used when authoring commits.
        // Defaults to `jreleaser@kordamp.org`.
        // 
        "email": "jreleaser@kordamp.org"
      },

      // Git repository to push the manifest to.
      // Defaults are shown.
      // 
      "snap": {

        // The owner of the snap repository.
        // Defaults to the same owner as the release repository.
        // 
        "owner": "duke",

        // The name of the snap repository.
        // Defaults to `app-snap`.
        // 
        "name": "app-snap",

        // The target branch to use.
        // May define a `JRELEASER_SNAP_${GIT}_BRANCH` environment variable instead.
        // Defaults to the branch pointed by HEAD.
        //  
        "branch": "HEAD",

        // Username used for authoring commits. Must have write access to the snap repository.
        // If left unspecified, the `JRELEASER_SNAP_${GIT}_USERNAME`
        // environment variable must be defined.
        // Defaults to the same username as the release repository.
        //  
        "username": "duke",

        // Password or OAuth token with write access to the snap repository.
        // If left unspecified, the `JRELEASER_SNAP_${GIT}_TOKEN`
        // environment variable must be defined.
        //  
        "token": "__DO_NOT_SET_HERE__"
      },

      // Exported snapcraft login credentials.
      // Will be sent to local snapcraft build with `snapcraft login --with ${exportedLogin}`.
      // Required if `remoteBuild` is set to `false`.
      "exportedLogin": "path/to/login/file",

      // Whether to build the package on a remote server or locally.
      // If set to `true` then the package must be configured to be built
      // via https://snapcraft.io.
      // Review the docs at https://snapcraft.io/build.
      // Defaults to `false`.
      // 
      "remoteBuild": false,

      // A snap of type base to be used as the execution environment for this snap.
      // Valid values are:
      // * bare - Empty base snap;
      // * core - Ubuntu Core 16;
      // * core20 - Ubuntu Core 20.
      // Defaults to `core20`.
      // 
      "base": "core20",

      // A guardrail to prevent you from releasing a snap to all your users before
      // it is ready.
      // `devel` will let you release only to the `edge` and `beta` channels in the
      // store. `stable` will let you release also to the `candidate` and `stable`
      // channels. More info about channels here:
      // https://snapcraft.io/docs/reference/channels.
      // Defaults to `stable`.
      // 
      "grade": "stable",

      // Snaps can be setup to follow three different confinement policies:
      // `strict`, `devmode` and `classic`. A strict confinement where the snap
      // can only read and write in its own namespace is recommended. Extra
      // permissions for strict snaps can be declared as `plugs` for the app, which
      // are explained later. More info about confinement here:
      // https://snapcraft.io/docs/reference/confinement.
      // Defaults to `strict`.
      // 
      "confinement": "strict",

      // List of plug names the application is associated with.
      // When a plug is connected to one of these slots, the application
      // will be granted the permissions specified for that interface.
      // If attributes are required, or the plug name does not match the
      // interface name, more details must be declared in the `plugs` field.
      // https://snapcraft.io/docs/reference/interfaces.
      // 
      "localPlugs" [
        "some_plug_name"
      ],

      // List of slot names the application is associated with.
      // When a plug is connected to one of these slots, the application
      // will be granted the permissions specified for that interface.
      // If attributes are required, or the slot name does not match the
      // interface name, more details must be declared in the `slots` field.
      // https://snapcraft.io/docs/reference/interfaces.
      // 
      "localSlots" [
        "some_slot_name"
      ],

      // Allows plugs to be configured.
      // 
      "plugs": [
        {
          "some_plug_name": {
            "key": "value"
          }
        }
      ],

      // Allows slots to be configured.
      // 
      "slots": [
        {
          "some_slot_name": {
            "key": "value",
            "read": [
              "$HOME/.foo"
            ],
            "write": [
              "$HOME/.foo",
              "$HOME/.foobar"
            ]
          }
        }
=       ]
    }
  }
}
<jreleaser>
  <!--
    
  -->
  <packagers>
    <!--
      
    -->
    <snap>
      <!--
        Enables or disables Snap.
        Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
        Defaults to `NEVER`.
        
      -->
      <active>ALWAYS</active>

      <!--
        Let the release continue if the packager fails.
        Defaults to `false`.
        
      -->
      <continueOnError>true</continueOnError>

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

      <!--
        Directory with file templates used to prepare the Snap distribution.
        Defaults to `src/jreleaser/distributions/${distribution.name}/snap`.
        If specified, path must exist.
        
      -->
      <templateDirectory>>path/to/snap/templates</templateDirectory>

      <!--
        Git author used to commit to the repository.
        
      -->
      <commitAuthor>

        <!--
           Name used when authoring commits.
          Defaults to `jreleaserbot`.
          
        -->
        <name>jreleaserbot</name>

        <!--
          E-mail used when authoring commits.
          Defaults to `jreleaser@kordamp.org`.
          
        -->
        <email>jreleaser@kordamp.org</email>
      </commitAuthor>

      <!--
        Git repository to push the manifest to.
        Defaults are shown.
        
      -->
      <snap>

        <!--
          The owner of the snap repository.
          Defaults to the same owner as the release repository.
          
        -->
        <owner>duke</owner>

        <!--
          The name of the snap repository.
          Defaults to `app-snap`.
          
        -->
        <name>app-snap</name>

        <!--
          The target branch to use.
          May define a `JRELEASER_SNAP_${GIT}_BRANCH`` environment variable instead.
          Defaults to the branch pointed by HEAD.
           
        -->
        <branch>HEAD</branch>

        <!--
          Username used for authoring commits. Must have write access to the snap repository.
          If left unspecified, the `JRELEASER_SNAP_${GIT}_USERNAME`
          environment variable must be defined.
          Defaults to the same username as the release repository.
           
        -->
        <username>duke</username>

        <!--
          Password or OAuth token with write access to the snap repository.
          If left unspecified, the `JRELEASER_SNAP_${GIT}_TOKEN`
          environment variable must be defined.
           
        -->
        <token>__DO_NOT_SET_HERE__</token>
      </snap>

      <!--
        Exported snapcraft login credentials.
        Will be sent to local snapcraft build with `snapcraft login --with ${exportedLogin}`.
        Required if `remoteBuild` is set to `false`.
      -->
      <exportedLogin>path/to/login/file</exportedLogin>

      <!--
        Whether to build the package on a remote server or locally.
        If set to `true` then the package must be configured to be built
        via https://snapcraft.io.
        Review the docs at https://snapcraft.io/build.
        Defaults to `false`.
        
      -->
      <remoteBuild>false</remoteBuild>

      <!--
        A snap of type base to be used as the execution environment for this snap.
        Valid values are:
        * bare - Empty base snap;
        * core - Ubuntu Core 16;
        * core20 - Ubuntu Core 20.
        Defaults to `core20`.
        
      -->
      <base>core20</base>

      <!--
        A guardrail to prevent you from releasing a snap to all your users before
        it is ready.
        `devel` will let you release only to the `edge` and `beta` channels in the
        store. `stable` will let you release also to the `candidate` and `stable`
        channels. More info about channels here:
        https://snapcraft.io/docs/reference/channels.
        Defaults to `stable`.
        
      -->
      <grade>stable</grade>

      <!--
        Snaps can be setup to follow three different confinement policies:
        `strict`, `devmode` and `classic`. A strict confinement where the snap
        can only read and write in its own namespace is recommended. Extra
        permissions for strict snaps can be declared as `plugs` for the app, which
        are explained later. More info about confinement here:
        https://snapcraft.io/docs/reference/confinement.
        Defaults to `strict`.
        
      -->
      <confinement>strict</confinement>

      <!--
        List of plug names the application is associated with.
        When a plug is connected to one of these slots, the application
        will be granted the permissions specified for that interface.
        If attributes are required, or the plug name does not match the
        interface name, more details must be declared in the `plugs` field.
        https://snapcraft.io/docs/reference/interfaces.
        
      -->
      <localPlugs>
        <localPlug>some_plug_name</localPlug>
      </localPlugs>

      <!--
        List of slot names the application is associated with.
        When a plug is connected to one of these slots, the application
        will be granted the permissions specified for that interface.
        If attributes are required, or the slot name does not match the
        interface name, more details must be declared in the `slots` field.
        https://snapcraft.io/docs/reference/interfaces.
        
      -->
      <localSlots>
        <localSlot>some_slot_name</localSlot>
      </localSlots>

      <!--
        Allows plugs to be configured.
        
      -->
      <plugs>
        <plug>
          <name>some_plug_name</name>
          <attributes>
            <key>value</key>
          </attributes>
        </plug>
      </plugs>

      <!--
        Allows slots to be configured.
        
      -->
      <slots>
        <slot>
          <name>some_slot_name</name>
          <attributes>
            <key>value</key>
          </attributes>
          <reads>
            <read>$HOME/.foo</read>
          </reads>
          <writes>
            <write>$HOME/.foo</write>
            <write>$HOME/.foobar</write>
          </writes>
        </slot>
      </slots>
    </snap>
  </packagers>
</jreleaser>
jreleaser {
  // 
  packagers {
    // 
    snap {
      // Enables or disables Snap.
      // Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
      // Defaults to `NEVER`.
      // 
      active = 'ALWAYS'

      // Let the release continue if the packager fails.
      // Defaults to `false`.
      // 
      continueOnError = true

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

      // Directory with file templates used to prepare the Snap distribution.
      // Defaults to `src/jreleaser/distributions/${distribution.name}/snap`.
      // If specified, path must exist.
      // 
      templateDirectory = 'path/to/snap/templates'

      // Git author used to commit to the repository.
      // 
      commitAuthor {
        // Name used when authoring commits.
        // Defaults to `jreleaserbot`.
        // 
        name = 'jreleaserbot'

        // E-mail used when authoring commits.
        // Defaults to `jreleaser@kordamp.org`.
        // 
        email = 'jreleaser@kordamp.org'
      }

      // Git repository to push the manifest to.
      // Defaults are shown.
      // 
      snap {

        // The owner of the snap repository.
        // Defaults to the same owner as the release repository.
        // 
        owner = 'duke'

        // The name of the snap repository.
        // Defaults to `app-snap`.
        // 
        name = 'app-snap'

        // The target branch to use.
        // May define a `JRELEASER_BRANCH` environment variable instead.
        // Defaults to the branch pointed by HEAD.
        //  
        branch = 'HEAD'

        // Username used for authoring commits. Must have write access to the snap repository.
        // If left unspecified, the `JRELEASER_SNAP_${GIT}_USERNAME`
        // environment variable must be defined.
        // Defaults to the same username as the release repository.
        //  
        username = 'duke'

        // Password or OAuth token with write access to the snap repository.
        // If left unspecified, the `JRELEASER_SNAP_${GIT}_TOKEN`
        // environment variable must be defined.
        //  
        token = '__DO_NOT_SET_HERE__'
      }

      // Exported snapcraft login credentials.
      // Will be sent to local snapcraft build with `snapcraft login --with ${exportedLogin}`.
      // Required if `remoteBuild` is set to `false`.
      exportedLogin = 'path/to/login/file'

      // Whether to build the package on a remote server or locally.
      // If set to `true` then the package must be configured to be built
      // via https://snapcraft.io.
      // Review the docs at https://snapcraft.io/build.
      // Defaults to `false`.
      // 
      remoteBuild = false

      // A snap of type base to be used as the execution environment for this snap.
      // Valid values are:
      // * bare - Empty base snap;
      // * core - Ubuntu Core 16;
      // * core20 - Ubuntu Core 20.
      // Defaults to `core20`.
      // 
      base = 'core20'

      // A guardrail to prevent you from releasing a snap to all your users before
      // it is ready.
      // `devel` will let you release only to the `edge` and `beta` channels in the
      // store. `stable` will let you release also to the `candidate` and `stable`
      // channels. More info about channels here:
      // https://snapcraft.io/docs/reference/channels.
      // Defaults to `stable`.
      // 
      grade = 'stable'

      // Snaps can be setup to follow three different confinement policies:
      // `strict`, `devmode` and `classic`. A strict confinement where the snap
      // can only read and write in its own namespace is recommended. Extra
      // permissions for strict snaps can be declared as `plugs` for the app, which
      // are explained later. More info about confinement here:
      // https://snapcraft.io/docs/reference/confinement.
      // Defaults to `strict`.
      // 
      confinement = 'strict'

      // List of plug names the application is associated with.
      // When a plug is connected to one of these slots, the application
      // will be granted the permissions specified for that interface.
      // If attributes are required, or the plug name does not match the
      // interface name, more details must be declared in the `plugs` field.
      // https://snapcraft.io/docs/reference/interfaces.
      // 
      addLocalPlug('some_plug_name')

      // List of slot names the application is associated with.
      // When a plug is connected to one of these slots, the application
      // will be granted the permissions specified for that interface.
      // If attributes are required, or the slot name does not match the
      // interface name, more details must be declared in the `slots` field.
      // https://snapcraft.io/docs/reference/interfaces.
      // 
      addLocalSlots('some_slot_name')

      // Allows plugs to be configured.
      // 
      plugs {
        some_plug_name {
          addAttribute('key', 'value')
        }
      }

      // Allows slots to be configured.
      // 
      slots {
        some_slot_name {
          addAttribute('key', 'value')
          addRead('$HOME/.foo')
          addWrite('$HOME/.foo')
          addWrite('$HOME/.foobar')
        }
      }
    }
  }
}

Template files may be initialized using the template command.

The snap token environment variable must match with the chosen Release service, that is, it must be one of [JRELEASER_SNAP_GITHUB_TOKEN, JRELEASER_SNAP_GITLAB_TOKEN, JRELEASER_SNAP_GITEA_TOKEN].

Assuming that the current version is 1.2.3, and a distribution named app, the above configuration will generate a snapcraft.yaml file out/jreleaser/snap/prepare, which may be published to app-snap

snapcraft.yaml
name: app
version: 1.2.3
summary: Sample app
description: Sample app

grade: stable
confinement: strict
base: core20
type: app

apps:
  app:
    command: $SNAP/bin/app
    environment:
      JAVA_HOME: "$SNAP/usr/lib/jvm/java/jre/"
      PATH: "$SNAP/bin:$PATH:$SNAP/usr/lib/jvm/java/jre/bin"

parts:
  app:
    plugin: dump
    source: https://github.com/duke/app/releases/download/v1.2.3/app-1.2.3.tar.gz
    source-checksum: sha256/8e74020ca5e7d01d25c34cf1bd53adcf78c77adf7b53530ae5e0baeb841cb43e
    stage-packages:
      - openjdk-8-jre
      - ca-certificates
      - ca-certificates-java
    organize:
      'usr/lib/jvm/java-8-openjdk*': usr/lib/jvm/java
    prime:
      - -usr/lib/jvm/java/lib/security/cacerts
      - -usr/lib/jvm/java/jre/lib/security/cacerts