/ktor-plugin-registry

Maintains a repository of all Ktor plugins

Primary LanguageKotlinApache License 2.0Apache-2.0

Ktor Plugin Registry

This project contains references to all Ktor plugins available in the web-based Ktor project generator and the IDEA plugin.

Adding a plugin

To add a new plugin, follow these easy steps:

  1. Publish your project to Maven.

    • Use the gradle maven publish plugin to publish to Maven Central or some other public Maven repository.
    • If you'd like to reference another repository, this can be referenced from the plugin manifest in Step 3.

  2. Fork and clone this repository.

  3. Run ./gradlew --console=plain -q createPlugin

    • This will prompt you with a couple questions about the new plugin.
    • After it is completed, you should have some new files in this structure:
    plugins
    └── server
        └── <group>
            ├── group.ktor.yaml
            └── <plugin-id>
                ├── versions.ktor.yaml
                └── 2.0
                    ├── manifest.ktor.yaml
                    ├── install,kt
                    └── documentation.md
    
    • You can include any number of install files for populating new projects. More information under templates/manifest.ktor.yaml. The existing plugin files under the plugins folder can also be useful reference for introducing new plugins.
    • If your plugin artifacts aren't published on Maven Central you may need to add an entry to the allRepositories() function in the Repositories.kt file.

  4. Run ./gradlew buildRegistry to test the new files.

  5. Run ./gradlew buildTestProject to generate a sample project.

    • You can now experiment with a project generated with your plugin.
    • Iterate on updating the new files, building the registry, and generating the test project until you're happy with the results.
  6. Create a pull request with the new changes.

    • Once merged, your plugin will be available in the ktor project generator.