319 lines
13 KiB
XML
319 lines
13 KiB
XML
<?xml version="1.0"?>
|
|
<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">
|
|
<parent>
|
|
<groupId>io.debezium</groupId>
|
|
<artifactId>debezium-parent</artifactId>
|
|
<version>0.1.0</version>
|
|
<relativePath>../pom.xml</relativePath>
|
|
</parent>
|
|
<modelVersion>4.0.0</modelVersion>
|
|
<artifactId>debezium-connector-mysql</artifactId>
|
|
<version>0.1.0</version>
|
|
<name>Debezium Connector for MySQL</name>
|
|
<packaging>jar</packaging>
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>io.debezium</groupId>
|
|
<artifactId>debezium-core</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>com.github.shyiko</groupId>
|
|
<artifactId>mysql-binlog-connector-java</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.kafka</groupId>
|
|
<artifactId>connect-api</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.slf4j</groupId>
|
|
<artifactId>slf4j-api</artifactId>
|
|
</dependency>
|
|
|
|
<!-- Testing -->
|
|
<dependency>
|
|
<groupId>io.debezium</groupId>
|
|
<artifactId>debezium-core</artifactId>
|
|
<type>test-jar</type>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>io.debezium</groupId>
|
|
<artifactId>debezium-embedded</artifactId>
|
|
<type>test-jar</type>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>io.debezium</groupId>
|
|
<artifactId>debezium-embedded</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>mysql</groupId>
|
|
<artifactId>mysql-connector-java</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.slf4j</groupId>
|
|
<artifactId>slf4j-log4j12</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>log4j</groupId>
|
|
<artifactId>log4j</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>junit</groupId>
|
|
<artifactId>junit</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.easytesting</groupId>
|
|
<artifactId>fest-assert</artifactId>
|
|
</dependency>
|
|
</dependencies>
|
|
<properties>
|
|
<!--
|
|
Specify the properties that will be used for setting up the integration tests' Docker container.
|
|
Note that the `dockerhost.ip` property is computed from the IP address of DOCKER_HOST, which will
|
|
work on all platforms. We'll set some of these as system properties during integration testing.
|
|
-->
|
|
<database.port>3306</database.port>
|
|
<database.user>mysqluser</database.user>
|
|
<database.password>mysqlpw</database.password>
|
|
<!--
|
|
By default, we should use the default Docker image. This propery is changed with different profiles.
|
|
-->
|
|
<docker.image>mysql/mysql-server:${version.mysql.server}</docker.image>
|
|
<docker.skip>false</docker.skip>
|
|
</properties>
|
|
<build>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>io.fabric8</groupId>
|
|
<artifactId>docker-maven-plugin</artifactId>
|
|
<configuration>
|
|
<watchInterval>500</watchInterval>
|
|
<logDate>default</logDate>
|
|
<verbose>true</verbose>
|
|
<autoPull>always</autoPull>
|
|
<images>
|
|
<image>
|
|
<!-- A Docker image using a partial MySQL installation maintained by MySQL team. -->
|
|
<name>mysql/mysql-server:${version.mysql.server}</name>
|
|
<alias>database</alias>
|
|
<run>
|
|
<namingStrategy>alias</namingStrategy>
|
|
<volumes>
|
|
<bind>
|
|
<volume>${project.basedir}/src/test/docker/server/mysql.cnf:/etc/my.cnf</volume>
|
|
<volume>${project.basedir}/src/test/docker/init:/docker-entrypoint-initdb.d</volume>
|
|
</bind>
|
|
</volumes>
|
|
<env>
|
|
<MYSQL_ROOT_PASSWORD>debezium-rocks</MYSQL_ROOT_PASSWORD>
|
|
<MYSQL_DATABASE>mysql</MYSQL_DATABASE> <!-- database created upon init -->
|
|
<MYSQL_USER>${database.user}</MYSQL_USER>
|
|
<MYSQL_PASSWORD>${database.password}</MYSQL_PASSWORD>
|
|
</env>
|
|
<ports>
|
|
<port>${database.port}:3306</port>
|
|
</ports>
|
|
<log>
|
|
<prefix>mysql</prefix>
|
|
<enabled>true</enabled>
|
|
<color>yellow</color>
|
|
</log>
|
|
<wait>
|
|
<log>MySQL init process done. Ready for start up.</log>
|
|
<time>30000</time> <!-- 30 seconds max -->
|
|
</wait>
|
|
</run>
|
|
</image>
|
|
<image>
|
|
<!-- A Docker image using a complete MySQL installation maintained by Docker team. -->
|
|
<name>mysql:${version.mysql.server}</name>
|
|
<alias>database</alias>
|
|
<run>
|
|
<namingStrategy>alias</namingStrategy>
|
|
<volumes>
|
|
<bind>
|
|
<volume>${project.basedir}/src/test/docker/alt-server:/etc/mysql/conf.d</volume>
|
|
<volume>${project.basedir}/src/test/docker/init:/docker-entrypoint-initdb.d</volume>
|
|
</bind>
|
|
</volumes>
|
|
<env>
|
|
<MYSQL_ROOT_PASSWORD>debezium-rocks</MYSQL_ROOT_PASSWORD>
|
|
<MYSQL_DATABASE>mysql</MYSQL_DATABASE> <!-- database created upon init -->
|
|
<MYSQL_USER>${database.user}</MYSQL_USER>
|
|
<MYSQL_PASSWORD>${database.password}</MYSQL_PASSWORD>
|
|
</env>
|
|
<ports>
|
|
<port>${database.port}:3306</port>
|
|
</ports>
|
|
<log>
|
|
<prefix>alt-mysql</prefix>
|
|
<enabled>true</enabled>
|
|
<color>yellow</color>
|
|
</log>
|
|
<wait>
|
|
<log>Version: \'5\.7\.11-log\' socket: \'/var/run/mysqld/mysqld\.sock\' port: 3306 MySQL Community Server \(GPL\)</log>
|
|
<time>30000</time>
|
|
</wait>
|
|
</run>
|
|
</image>
|
|
</images>
|
|
</configuration>
|
|
<!--
|
|
Connect this plugin to the maven lifecycle around the integration-test phase:
|
|
start the container in pre-integration-test and stop it in post-integration-test.
|
|
-->
|
|
<executions>
|
|
<execution>
|
|
<id>start</id>
|
|
<phase>pre-integration-test</phase>
|
|
<goals>
|
|
<goal>build</goal>
|
|
<goal>start</goal>
|
|
</goals>
|
|
</execution>
|
|
<execution>
|
|
<id>stop</id>
|
|
<phase>post-integration-test</phase>
|
|
<goals>
|
|
<goal>stop</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<!--
|
|
Unlike surefire, the failsafe plugin ensures 'post-integration-test' phase always runs, even
|
|
when there are failed integration tests. We rely upon this to always shut down the Docker container
|
|
after the integration tests (defined as '*IT.java') are run.
|
|
-->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-failsafe-plugin</artifactId>
|
|
<executions>
|
|
<execution>
|
|
<id>integration-test</id>
|
|
<goals>
|
|
<goal>integration-test</goal>
|
|
</goals>
|
|
</execution>
|
|
<execution>
|
|
<id>verify</id>
|
|
<goals>
|
|
<goal>verify</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
<configuration>
|
|
<skipTests>${skipITs}</skipTests>
|
|
<enableAssertions>true</enableAssertions>
|
|
<systemPropertyVariables>
|
|
<!-- Make these available to the tests via system properties -->
|
|
<database.hostname>${docker.host.address}</database.hostname>
|
|
<database.port>${database.port}</database.port>
|
|
<database.user>${database.user}</database.user>
|
|
<database.password>${database.password}</database.password>
|
|
<skipLongRunningTests>${skipLongRunningTests}</skipLongRunningTests>
|
|
</systemPropertyVariables>
|
|
</configuration>
|
|
</plugin>
|
|
</plugins>
|
|
<resources>
|
|
<!-- Apply the properties set in the POM to the resource files -->
|
|
<resource>
|
|
<filtering>true</filtering>
|
|
<directory>src/main/resources</directory>
|
|
<includes>
|
|
<include>*</include>
|
|
<include>**/*</include>
|
|
</includes>
|
|
</resource>
|
|
</resources>
|
|
<testResources>
|
|
<testResource>
|
|
<directory>src/test/resources</directory>
|
|
<filtering>true</filtering>
|
|
<includes>
|
|
<include>*</include>
|
|
<include>**/*</include>
|
|
</includes>
|
|
</testResource>
|
|
</testResources>
|
|
</build>
|
|
<!--
|
|
Define several useful profiles
|
|
-->
|
|
<profiles>
|
|
<profile>
|
|
<id>assembly</id>
|
|
<activation>
|
|
<activeByDefault>false</activeByDefault>
|
|
</activation>
|
|
<build>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-assembly-plugin</artifactId>
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>io.debezium</groupId>
|
|
<artifactId>debezium-assembly-descriptors</artifactId>
|
|
<version>${project.version}</version>
|
|
</dependency>
|
|
</dependencies>
|
|
<executions>
|
|
<execution>
|
|
<id>default</id>
|
|
<phase>package</phase>
|
|
<goals>
|
|
<goal>single</goal>
|
|
</goals>
|
|
<configuration>
|
|
<finalName>${project.artifactId}-${project.version}</finalName>
|
|
<attach>true</attach> <!-- we want attach & deploy these to Maven -->
|
|
<descriptorRefs>
|
|
<descriptorRef>connector-distribution</descriptorRef>
|
|
</descriptorRefs>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
</profile>
|
|
|
|
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
Do not perform any Docker-related functionality
|
|
To use, specify "-DskipITs" on the Maven command line.
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
|
|
<profile>
|
|
<id>skip-integration-tests</id>
|
|
<activation>
|
|
<activeByDefault>false</activeByDefault>
|
|
<property>
|
|
<name>skipITs</name>
|
|
</property>
|
|
</activation>
|
|
<properties>
|
|
<docker.skip>true</docker.skip>
|
|
</properties>
|
|
</profile>
|
|
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
Use the alternative Docker image for MySQL.
|
|
To use, specify "-Dalt-mysql" or -Palt-mysql on the Maven command line.
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
|
|
<profile>
|
|
<id>alt-mysql</id>
|
|
<activation>
|
|
<activeByDefault>false</activeByDefault>
|
|
<property>
|
|
<name>alt-mysql</name>
|
|
</property>
|
|
</activation>
|
|
<properties>
|
|
<docker.image>mysql:${version.mysql.server}</docker.image>
|
|
<docker.skip>false</docker.skip>
|
|
</properties>
|
|
</profile>
|
|
</profiles>
|
|
</project> |