trino icon indicating copy to clipboard operation
trino copied to clipboard

Add a Maven Archetype for creating new Trino plugins

Open nineinchnick opened this issue 3 years ago • 4 comments

Description

Add a Maven Archetype to make it easier to create new Trino plugins. It creates a new plugin with a connector that has a single table with 3 columns, and it returns a single row with constant values. It includes integration tests that actually create a new project and run its (integration) tests.

The archetype is created during the build from an actual plugin. There's a new plugin that is not under the Trino project root, assuming new plugins created using this archetype would not be submitted to the Trino project.

A previous attempt is in #12605

Is this change a fix, improvement, new feature, refactoring, or other? new feature

Is this a change to the core query engine, a connector, client library, or the SPI interfaces? (be specific) plugins

How would you describe this change to a non-technical end user or system administrator? The Maven Archetype makes it easier to create a new Trino plugin from scratch

Related issues, pull requests, and links

Documentation

( ) No documentation is needed. (x) Sufficient documentation is included in this PR. ( ) Documentation PR is available with #prnumber. ( ) Documentation issue #issuenumber is filed, and can be handled later.

Release notes

(x) No release notes entries required. ( ) Release notes entries required with the following suggested text:

# Section
* Fix some things. ({issue}`issuenumber`)

nineinchnick avatar Jun 22 '22 12:06 nineinchnick

@martint PTAL and note I added another plugin example that's not using the io.trino group on purpose. It should not be "deployed" during a release, but we probably want it to be built with all other modules. WDYT?

nineinchnick avatar Jun 23 '22 08:06 nineinchnick

@martint PTAL. I added a fixup commit to show what it takes to update this to the latest version. Your idea with a regular project worked great, there was one deprecated arg removed and I was able to fix that easily.

nineinchnick avatar Jul 24 '22 10:07 nineinchnick

I like this approach, since the plugin is a normal plugin module that gets built and tested as usual. Can you split the commits so that the example plugin is added first? That will make it easier to review and see the archtype bits.

electrum avatar Jul 27 '22 02:07 electrum

@electrum I split the commits, @martint the new example plugin shouldn't get published now, PTAL

nineinchnick avatar Jul 27 '22 16:07 nineinchnick

@electrum @martint PTAL

nineinchnick avatar Aug 19 '22 12:08 nineinchnick

@electrum @martint PTAL

nineinchnick avatar Aug 29 '22 08:08 nineinchnick

@electrum @martint PTAL, or maybe suggest other reviewers

nineinchnick avatar Sep 06 '22 13:09 nineinchnick

@electrum @martint PTAL, we're getting questions about creating new plugins on the Trino Slack from time to time

nineinchnick avatar Oct 26 '22 12:10 nineinchnick

@martint I mentioned this PR when we last talked in Warsaw, PTAL.

nineinchnick avatar Nov 15 '22 11:11 nineinchnick

I'm having huge issues with running this in offline mode. Looks like org.apache.maven.plugins:maven-archetype-plugin:3.2.1:create-from-project has goals defined without plugin versions (maybe here?) and doesn't use the default Maven versions (like Maven does when you run it in a dir without any POM). It fails to resolve the version of the install plugin even though we're not executing this phase (-Darchetype.postPhase=validate).

I give up. We either have to:

  • disable offline mode
  • avoid using create-from-project or write a custom tool
  • fix this upstream, but I'm not even sure what's the root cause

nineinchnick avatar Mar 11 '23 11:03 nineinchnick

@electrum PTAL again, I just rebased it

nineinchnick avatar Feb 20 '24 18:02 nineinchnick

Looks like there's no interest in this anymore.

nineinchnick avatar Feb 27 '24 11:02 nineinchnick