Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Support custom extensions #929

Closed
aalmiray opened this issue Aug 31, 2022 · 2 comments
Closed

[core] Support custom extensions #929

aalmiray opened this issue Aug 31, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request released Issue has been released
Milestone

Comments

@aalmiray
Copy link
Member

aalmiray commented Aug 31, 2022

Define a mechanism to load, configure, and execute custom extensions.

Packaging

Extensions may be packaged in 3 ways:

  • single JAR file. Either the extension has no dependencies or it's an uberjar.
  • zip file. Contains a set of JAR files. This includes the extension plus its dependencies.
  • set of JAR files. This includes the extension plus its dependencies.

Location

Extensions should be placed at ${JRELEASER_HOME}/extensions/<extension-name>/. However, this location may be overridden by configuring an explicit value via the DSL

DSL

Here's how it may look like

extensions:
  foo:
    providers:
      - type: com.github.foo.MustacheFunctionProvider
        properties:
          maxLength: 20
  bar:
    directory: /path/to/the/jars
  qux:
    enabled: false

Extension foo will be loaded from ${JRELEASER_HOME}/extensions/foo. It may be packaged as foo-x.y.z.jar, foo.-x.y.z.zip, or as a set of JAR files inside that directory.
It lists an explicit type com.github.foo.MustacheFunctionProvider which requires additional settings upon initialization. These settings are defined using the properties map. There may be more than one provider type hence a list.

Extension bar will be loaded from /path/to/the/jars. It may be packaged as bar-x.y.z.jar, bar.-x.y.z.zip, or as a set of JAR files inside that directory.

Loading Mechanism

Each extension will be loaded and initialized upon bootstrap after resolving the model. Extensions will be treated as singletons per each invocation session. JReleaser will use the ServiceLoader SPI interface to locate, load, and initialize extensions.

@aalmiray aalmiray added the enhancement New feature or request label Aug 31, 2022
@aalmiray aalmiray self-assigned this Sep 3, 2022
@aalmiray
Copy link
Member Author

aalmiray commented Sep 9, 2022

Also consider an option for declaring GAV coordinates to download an extension and its transitive dependencies.

@aalmiray
Copy link
Member Author

@aalmiray aalmiray added the released Issue has been released label Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released Issue has been released
Projects
None yet
Development

No branches or pull requests

1 participant