trino
trino copied to clipboard
Add a Maven Archetype for creating new Trino plugins
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`)
@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?
@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.
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 I split the commits, @martint the new example plugin shouldn't get published now, PTAL
@electrum @martint PTAL
@electrum @martint PTAL
@electrum @martint PTAL, or maybe suggest other reviewers
@electrum @martint PTAL, we're getting questions about creating new plugins on the Trino Slack from time to time
@martint I mentioned this PR when we last talked in Warsaw, PTAL.
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-projector write a custom tool - fix this upstream, but I'm not even sure what's the root cause
@electrum PTAL again, I just rebased it
Looks like there's no interest in this anymore.