Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Apache Dolphinscheduler Maven Plugin Module Setup

From Leeroopedia


Knowledge Sources
Domains Plugin_Architecture, Build_Systems
Last Updated 2026-02-10 00:00 GMT

Overview

Concrete tool for creating a new datasource plugin module using Maven POM inheritance from the DolphinScheduler datasource plugin parent.

Description

Each datasource plugin in DolphinScheduler is a Maven module that inherits from the dolphinscheduler-datasource-plugin parent POM. The module includes dependencies on dolphinscheduler-datasource-api (base classes), google-auto-service (SPI registration), and database-specific JDBC drivers. The standard package structure follows org.apache.dolphinscheduler.plugin.datasource.{dbtype}.

Usage

Use this when creating a new database datasource plugin for DolphinScheduler. Create a new Maven module directory under dolphinscheduler-datasource-plugin/ with the naming convention dolphinscheduler-datasource-{dbtype}.

Code Reference

Source Location

  • Repository: dolphinscheduler
  • File: dolphinscheduler-datasource-plugin/dolphinscheduler-datasource-mysql/pom.xml (reference)

Signature

<project>
    <parent>
        <groupId>org.apache.dolphinscheduler</groupId>
        <artifactId>dolphinscheduler-datasource-plugin</artifactId>
        <version>${revision}</version>
    </parent>

    <artifactId>dolphinscheduler-datasource-{dbtype}</artifactId>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>org.apache.dolphinscheduler</groupId>
            <artifactId>dolphinscheduler-datasource-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.auto.service</groupId>
            <artifactId>auto-service</artifactId>
        </dependency>
        <!-- Database-specific JDBC driver -->
    </dependencies>
</project>

Import

N/A - This is a build configuration pattern, not a Java import.

I/O Contract

Inputs

Name Type Required Description
Plugin name String Yes Database type identifier (e.g., mysql, postgresql)
JDBC driver Maven dependency Yes Database-specific JDBC driver artifact
Parent POM POM inheritance Yes Must inherit from dolphinscheduler-datasource-plugin

Outputs

Name Type Description
Maven module Directory Complete module with pom.xml, src/main/java, src/test/java
Plugin JAR JAR file Compiled plugin with META-INF/services for SPI

Usage Examples

MySQL Plugin Module POM

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.apache.dolphinscheduler</groupId>
        <artifactId>dolphinscheduler-datasource-plugin</artifactId>
        <version>${revision}</version>
    </parent>

    <artifactId>dolphinscheduler-datasource-mysql</artifactId>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>org.apache.dolphinscheduler</groupId>
            <artifactId>dolphinscheduler-datasource-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.auto.service</groupId>
            <artifactId>auto-service</artifactId>
        </dependency>
        <dependency>
            <groupId>com.mysql</groupId>
            <artifactId>mysql-connector-j</artifactId>
        </dependency>
    </dependencies>
</project>

Package Structure

dolphinscheduler-datasource-mysql/
├── pom.xml
└── src/
    ├── main/java/org/apache/dolphinscheduler/plugin/datasource/mysql/
    │   ├── MySQLDataSourceChannel.java
    │   ├── MySQLDataSourceChannelFactory.java
    │   └── param/
    │       ├── MySQLConnectionParam.java
    │       ├── MySQLDataSourceParamDTO.java
    │       └── MySQLDataSourceProcessor.java
    └── test/java/org/apache/dolphinscheduler/plugin/datasource/mysql/
        └── param/
            └── MySQLDataSourceProcessorTest.java

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment