<!--

    Copyright 2010-2017 Boxfuse GmbH

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<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">
    <!--
    Detailed information how to contribute: https://flywaydb.org/documentation/contribute/code/

    The OS-specific JREs are unfortunately not available from Maven Central due to licensing issues.
    Instructions for installing them: https://flywaydb.org/documentation/contribute/devEnvironmentSetup.html

    To avoid building the OS-specific flyway-commandline assemblies you can run the build with:
    mvn -P-CommandlinePlatformAssemblies
    -->
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.flywaydb</groupId>
        <artifactId>flyway-parent</artifactId>
        <version>4.2.0</version>
    </parent>
    <artifactId>flyway-commandline</artifactId>
    <packaging>jar</packaging>
    <name>${project.artifactId}</name>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://github.com/flyway/flyway/blob/master/LICENSE.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <properties>
        <jreversion>1.8.0_74</jreversion>
    </properties>
    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>flyway-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.derby</groupId>
            <artifactId>derby</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.derby</groupId>
            <artifactId>derbyclient</artifactId>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.jtds</groupId>
            <artifactId>jtds</artifactId>
        </dependency>
        <dependency>
            <groupId>com.pivotal.jdbc</groupId>
            <artifactId>greenplumdriver</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mariadb.jdbc</groupId>
            <artifactId>mariadb-java-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
        </dependency>
        <dependency>
            <groupId>org.xerial</groupId>
            <artifactId>sqlite-jdbc</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-license</id>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <phase>generate-resources</phase>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>..</directory>
                                    <includes>
                                        <include>LICENSE.txt</include>
                                        <include>README.txt</include>
                                    </includes>
                                </resource>
                            </resources>
                            <outputDirectory>${project.build.outputDirectory}/META-INF</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <appendAssemblyId>false</appendAssemblyId>
                            <descriptors>
                                <descriptor>src/main/assembly/no-jre.xml</descriptor>
                            </descriptors>
                            <encoding>UTF-8</encoding>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>CommercialDBTest</id>
            <!--
            Should work, but somehow doesn't as any attempt to disable this profile for TravisCI fails
            <id>CommandlinePlatformAssemblies</id>
            -->
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.oracle</groupId>
                    <artifactId>server-jre</artifactId>
                    <classifier>windows-x64</classifier>
                    <type>tar.gz</type>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>com.oracle</groupId>
                    <artifactId>server-jre</artifactId>
                    <classifier>linux-x64</classifier>
                    <type>tar.gz</type>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>com.oracle</groupId>
                    <artifactId>jre</artifactId>
                    <classifier>macosx-x64</classifier>
                    <type>tar.gz</type>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>unpack-jres</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>unpack-dependencies</goal>
                                </goals>
                                <configuration>
                                    <ignorePermissions>true</ignorePermissions>
                                    <includeTypes>tar.gz</includeTypes>
                                    <stripVersion>true</stripVersion>
                                    <useSubDirectoryPerArtifact>true</useSubDirectoryPerArtifact>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>make-assembly-windows</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                                <configuration>
                                    <!-- attach must be false until https://issues.sonatype.org/browse/MVNCENTRAL-631 is fixed -->
                                    <!--attach>false</attach-->
                                    <descriptors>
                                        <descriptor>src/main/assembly/windows.xml</descriptor>
                                        <descriptor>src/main/assembly/linux.xml</descriptor>
                                        <descriptor>src/main/assembly/macosx.xml</descriptor>
                                    </descriptors>
                                    <encoding>UTF-8</encoding>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                            <systemProperties>
                                <target.dir>${project.build.directory}</target.dir>
                            </systemProperties>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
