This project contains references to all Ktor plugins available in the web-based Ktor project generator and the IDEA plugin.
To add a new plugin, follow these easy steps:
-
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.
-
Fork and clone this repository.
-
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.
-
Run
./gradlew buildRegistry
to test the new files. -
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.
-
Create a pull request with the new changes.
- Once merged, your plugin will be available in the ktor project generator.