Trino is fully customizable with custom plugins. Those plugins can be developed in Java and deployed to Trino clusters. One of the aspects of success in development Trino plugins depends on your development environment. If you are able to mimic the Trino team environment, you might encounter less issues and problems during development and debug stages. The article shows some mandatory or preferable steps before starting your plugin.

The sample is created in CentOS 7 for Trino 393.

1. Java 17 is supported and the minimum version is 17.0.3.

java --version

2. Maven is installed. Minimal Maven version is 3.6.0 for Java 17 as per Maven documentation.

mvn --version

3. Generate a new plugin project in Maven

mvn archetype:generate -DgroupId=com.sample.plugin -DartifactId=sample-plugin -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

The command creates a new subfolder with sample-plugin name. The subfolder includes pom.xml file and children folders as per groupId=com.sample.plugin parameter.

4. Go to the new folder

cd sample-plugin

5. Modify pom file

<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">

  <description>Trino - Sample Plugin</description>


    <!-- Trino mandatory dependency -->

    <!-- Add your dependencies -->

    <!-- Quick start archetype test if needed-->

6. Unpack the maven-wrapper distribution files to the current project source tree

mvn wrapper:wrapper

The Maven Wrapper makes life easier to ensure that your Maven build has everything necessary to run your Maven build. It is added .mvn subfolder, and mvnw and mvnw.cmd files.

7. Create the package

./mvnw clean package dependency:copy-dependencies

Instead of mvn command, the Maven wrapper is used.

8. Test

java -cp target/sample-plugin-393.jar com.sample.plugin.App

This test is not plugin test. It's just test to validate the development environment.

9. Clean up the project from the sample

  • Delete sample code
  • Delete tests
  • Remove junit dependency from pom file

10. Add your plugin code



comments powered by Disqus