pom.xml 5.0 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
<?xml version="1.0" encoding="UTF-8"?>
<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>
        <artifactId>trainsys</artifactId>
        <groupId>cn.ibizlab.trainsys</groupId>
        <version>1.0.0.0</version>
    </parent>

    <artifactId>trainsys-core</artifactId>
    <name>Trainsys Core</name>
    <description>Trainsys Core</description>

    <dependencies>
        <!--  Liquibase  -->
        <dependency>
            <groupId>org.liquibase</groupId>
            <artifactId>liquibase-core</artifactId>
            <version>3.9.0</version>
        </dependency>

        <!--  H2  -->
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>1.4.200</version>
        </dependency>     
	</dependencies>


    <properties>
        <maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
    </properties>

    <profiles>
        <profile>
            <id>diff</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.liquibase</groupId>
                        <artifactId>liquibase-maven-plugin</artifactId>
                        <version>${liquibase.version}</version>
                        <executions>
                            <execution>
                                <id>prepare-newdb</id>
                                <configuration>
                                    <changeLogFile>${project.basedir}/src/main/resources/liquibase/h2_table.xml</changeLogFile>
                                    <driver>org.h2.Driver</driver>
                                    <url>jdbc:h2:file:${project.build.directory}/db/new;MODE=mysql</url>
                                    <username>root</username>
                                    <dropFirst>true</dropFirst>
                                </configuration>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>update</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>prepare-olddb</id>
                                <configuration>
                                    <changeLogFile>${project.basedir}/src/main/resources/liquibase/master_table.xml</changeLogFile>
                                    <driver>org.h2.Driver</driver>
                                    <url>jdbc:h2:file:${project.build.directory}/db/last;MODE=mysql</url>
                                    <username>root</username>
                                    <dropFirst>true</dropFirst>
                                </configuration>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>update</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>make-diff</id>
                                <configuration>
                                    <changeLogFile>${project.basedir}/src/main/resources/liquibase/changelog/empty.xml</changeLogFile>
                                    <diffChangeLogFile>${project.basedir}/src/main/resources/liquibase/changelog/${maven.build.timestamp}_changelog.xml</diffChangeLogFile>
                                    <driver>org.h2.Driver</driver>
                                    <url>jdbc:h2:file:${project.build.directory}/db/last;MODE=mysql</url>
                                    <username>root</username>
                                    <password></password>
                                    <referenceUrl>jdbc:h2:file:${project.build.directory}/db/new;MODE=mysql</referenceUrl>
                                    <referenceDriver>org.h2.Driver</referenceDriver>
                                    <referenceUsername>root</referenceUsername>
                                    <verbose>true</verbose>
                                    <logging>debug</logging>
                                    <contexts>!test</contexts>
                                    <diffExcludeObjects>Index:.*,table:ibzfile,ibzuser,ibzdataaudit,ibzcfg,IBZFILE,IBZUSER,IBZDATAAUDIT,IBZCFG</diffExcludeObjects>
                                </configuration>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>diff</goal>
                                </goals>
                            </execution>
                        </executions>

                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>


</project>