tet123/debezium-connector-mysql/pom.xml

418 lines
18 KiB
XML
Raw Normal View History

<?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.2-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>debezium-connector-mysql</artifactId>
<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>
DBZ-64 Added Avro Converter to record verification utilities The `VerifyRecord` utility class has methods that will verify a `SourceRecord`, and is used in many of our integration tests to check whether records are constructed in a valid manner. The utility already checks whether the records can be serialized and deserialized using the JSON converter (provided with Kafka Connect); this change also checks with the Avro Converter (which produces much smaller records and is more suitable for production). Note that version 3.0.0 of the Confluent Avro Converter is required; version 2.1.0-alpha1 could not properly handle complex Schema objects with optional fields (see https://github.com/confluentinc/schema-registry/pull/280). Also, the names of the Kafka Connect schemas used in MySQL source records has changed. # The record's envelope Schema used to be "<serverName>.<database>.<table>" but is now "<serverName>.<database>.<table>.Envelope". # The Schema for record keys used to be named "<database>.<table>/pk", but the '/' character is not valid within a Avro name, and has been changed to "<serverName>.<database>.<table>.Key". # The Schema for record values used to be named "<database>.<table>", but to better fit with the other Schema names it has been changed to "<serverName>.<database>.<table>.Value". Thus, all of the Schemas for a single database table have the same Avro namespace "<serverName>.<database>.<table>" (or "<topicName>") with Avro schema names of "Envelope", "Key", and "Value". All unit and integration tests pass.
2016-06-02 23:23:27 +02:00
<dependency>
<groupId>io.confluent</groupId>
<artifactId>kafka-connect-avro-converter</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 docker image maintained by the MySQL team. This property is changed with different profiles.
-->
<docker.image>debezium/mysql-server-test-databases</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>debezium/mysql-server-test-databases</name>
<alias>database</alias>
<run>
<namingStrategy>alias</namingStrategy>
<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>
<build>
<from>mysql/mysql-server:${version.mysql.server}</from>
<assembly>
<inline>
<fileSets>
<fileSet>
<directory>${project.basedir}/src/test/docker/server</directory>
<includes>
<include>my.cnf</include>
</includes>
<outputDirectory>etc/mysql</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.basedir}/src/test/docker/init</directory>
<outputDirectory>docker-entrypoint-initdb.d</outputDirectory>
</fileSet>
</fileSets>
</inline>
<basedir>/</basedir>
</assembly>
</build>
</image>
<image>
<!-- A Docker image using a partial MySQL installation maintained by MySQL team. -->
<name>debezium/mysql-server-gtids-test-databases</name>
<alias>database</alias>
<run>
<namingStrategy>alias</namingStrategy>
<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>
<build>
<from>mysql/mysql-server:${version.mysql.server}</from>
<assembly>
<inline>
<fileSets>
<fileSet>
<directory>${project.basedir}/src/test/docker/server-gtids</directory>
<includes>
<include>my.cnf</include>
</includes>
<outputDirectory>etc/mysql</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.basedir}/src/test/docker/init</directory>
<outputDirectory>docker-entrypoint-initdb.d</outputDirectory>
</fileSet>
</fileSets>
</inline>
<basedir>/</basedir>
</assembly>
</build>
</image>
<image>
<!-- A Docker image using a complete MySQL installation maintained by Docker team. -->
<name>debezium/mysql-test--databases</name>
<alias>database</alias>
<run>
<namingStrategy>alias</namingStrategy>
<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>
<build>
<from>mysql:${version.mysql.server}</from>
<assembly>
<inline>
<fileSets>
<fileSet>
<directory>${project.basedir}/src/test/docker/alt-server</directory>
<includes>
<include>my.cnf</include>
</includes>
<outputDirectory>etc/mysql/conf.d</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.basedir}/src/test/docker/init</directory>
<outputDirectory>docker-entrypoint-initdb.d</outputDirectory>
</fileSet>
</fileSets>
</inline>
<basedir>/</basedir>
</assembly>
</build>
</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>
2016-03-17 21:58:27 +01:00
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
2016-03-17 21:58:27 +01:00
<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>debezium/mysql-test--databases</docker.image>
<docker.skip>false</docker.skip>
</properties>
</profile>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the Docker image for MySQL configured to use GTIDs.
To use, specify "-Dgtid-mysql" or -Pgtid-mysql on the Maven command line.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<profile>
<id>gtid-mysql</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>gtid-mysql</name>
</property>
</activation>
<properties>
<docker.image>debezium/mysql-server-gtids-test-databases</docker.image>
<docker.skip>false</docker.skip>
</properties>
</profile>
</profiles>
</project>