Driver build produces no __init.class and fails to load in Metabase (custom IoTDB driver)

Environment

  • Metabase version: 0.56.10.x

  • Custom driver: Apache IoTDB (JDBC 2.0.6-ls from private Maven repo: https://repo.custom.com)

  • Build environment: Linux

  • Build method: Running ./bin/build-driver.sh iotdb under the Metabase source root

  • Metabase installation: Docker container

Problem Description

When running the official Metabase build script:

./bin/build-driver.sh iotdb

The build completes without explicit errors, but the compiled classes are not generated, specifically:

metabase/driver/iotdb__init.class
metabase/driver/iotdb.class

Only the .clj file appears inside the JAR:

/data/workspace/data/metabase/modules/drivers/iotdb/target/jar/metabase/driver/iotdb.clj

However, when starting Metabase or trying to require the namespace, we get:

metabase/driver/iotdb.clj not found in classpath

Questions

  1. How should a third-party driver properly depend on or extend sql-jdbc during the build-driver.sh process?

  2. Is there a supported way to add modules/drivers/sql-jdbc to the build classpath (via deps.edn or build alias)?

  3. Could build-driver.sh be improved to print compile-time errors instead of silently skipping them?

The code detail

iotdb.clj

(ns metabase.driver.iotdb
  "Metabase driver for Apache IoTDB (Custom JDBC)"
  (:require [metabase.driver :as driver]
            [metabase.driver.sql-jdbc :as sql-jdbc]
            [metabase.driver.sql-jdbc.connection :as sql-jdbc.conn]))

;; 注册驱动,继承自sql-jdbc
(driver/register! :iotdb :parent :sql-jdbc)

;; 定义连接字符串模板
(defn- connection-details->spec [details]
  (let [host (get details :host "localhost")
        port (get details :port 6667)
        url (format "jdbc:iotdb://%s:%s/" host port)]
    (merge {:classname "org.apache.iotdb.jdbc.IoTDBDriver"
            :subprotocol "iotdb"
            :subname url
            :user (get details :user)
            :password (get details :password)}
           (dissoc details :host :port :user :password))))

;; 实现必要的协议方法
(defmethod sql-jdbc.conn/connection-details->spec :iotdb
  [_ details]
  (connection-details->spec details))



plugin.json

{
  "name": "Metabase IoTDB Driver",
  "version": "1.0.0",
  "description": "Allows Metabase to connect to Apache IoTDB databases.",
  "driver": {
    "name": "iotdb",
    "display-name": "Apache IoTDB",
    "lazy-load": true,
    "parent": "sql-jdbc",
    "connection-properties": [
      "host",
      {
        "merge": [
          "port",
          {"placeholder": 6667}
        ]
      },
      "user",
      "password",
      "cloud-ip-address-info",
      "advanced-options-start",
      "default-advanced-options"
    ]
  },
  "init": [
    {
      "step": "load-namespace",
      "namespace": "metabase.driver.iotdb"
    },
    {
      "step": "register-jdbc-driver",
      "class": "org.apache.iotdb.jdbc.IoTDBDriver"
    }
  ]
}

deps.edn

{:paths
 ["src" "resources"]

 :deps
 {org.apache.iotdb/iotdb-jdbc {:mvn/version "2.0.6"}}
}