Skip to content

Plugin Development

If you need some extra features MongoCamp Server does not offer you, you can extend your instance by write your own plugin. A Sample Implementation you can see in our ShowCase Sample Plugin.

scala
import dev.quadstingray.sbt.json.JsonFile

val json = JsonFile(file("package.json"))

name := json.stringValue("name")

organization := json.stringValue("organization")

scalaVersion := "2.13.10"

libraryDependencies += "dev.mongocamp" %% "mongocamp-server" % "1.3.1"

publishTo := Some("GitHub Package Registry".at("https://maven.pkg.github.com/mongocamp/mongocamp-sample-plugin/"))

credentials += Credentials("GitHub Package Registry", "maven.pkg.github.com", System.getenv("GITHUB_USER"), System.getenv("GITHUB_TOKEN"))

mainClass := Some("dev.mongocamp.server.Server")

You can add all your extra dependencies to your build.sbt. If you use the preferred way to import plugins all dependencies are resolved automatically.

To make your own plugin functional and loaded you have to implement one of this Scala Traits:

Released under the Apache License 2.0.