<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>com.github.mcollovati.vertx</groupId>
        <artifactId>vertx-vaadin-root</artifactId>
        <version>0.4.1-SNAPSHOT</version>
    </parent>

    <artifactId>vertx-vaadin-flow</artifactId>
    <packaging>jar</packaging>
    <name>vertx-vaadin-flow</name>
    <version>0.1.0</version>
    <description>An adapter to run Vaadin Flow applications on Vertx</description>
    <url>https://github.com/mcollovati/vertx-vaadin</url>

    <properties>
        <bintray.package>vertx-vaadin-flow</bintray.package>
        <vaadin.version>10.0.6</vaadin.version>
        <flow.version>1.0.5</flow.version>
        <checkstyle.skip>false</checkstyle.skip>
        <classgraph.version>4.4.12</classgraph.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-core</artifactId>
        </dependency>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-web</artifactId>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-core</artifactId>
            <version>${vaadin.version}</version>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>flow-server</artifactId>
            <version>${flow.version}</version>
        </dependency>

        <dependency>
            <groupId>com.github.mcollovati.vertx</groupId>
            <artifactId>vaadin-flow-sockjs</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!--
        <dependency>
            <groupId>io.github.lukehutch</groupId>
            <artifactId>fast-classpath-scanner</artifactId>
            <version>LATEST</version>
        </dependency>
        -->
        <dependency>
            <groupId>io.github.classgraph</groupId>
            <artifactId>classgraph</artifactId>
            <version>${classgraph.version}</version>
        </dependency>
        <dependency>
            <groupId>com.github.mcollovati.vertx</groupId>
            <artifactId>vaadin-flow-sockjs</artifactId>
            <version>${project.version}</version>
        </dependency>

        

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-unit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-hazelcast</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.pholser</groupId>
            <artifactId>junit-quickcheck-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.pholser</groupId>
            <artifactId>junit-quickcheck-generators</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <pluginRepositories>
        <pluginRepository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases</url>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

    <repositories>
        <!--
        <repository>
            <id>vaadin-addons</id>
            <url>http://maven.vaadin.com/vaadin-addons</url>
        </repository>
        <repository>
            <id>webjars</id>
            <url>https://dl.bintray.com/webjars/maven</url>
        </repository>
        -->
        <repository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
        <repository>
            <id>vaadin-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/vaadin-snapshots</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
    </repositories>

    <profiles>
        <profile>
            <id>do-release</id>
            <activation>
                <property>
                    <name>vertx-vaadin.release</name>
                </property>
            </activation>
        </profile>
        <profile>
            <id>full</id>
            <activation>
                <property>
                    <name>vertx-vaadin.release</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-shade-plugin</artifactId>
                        <version>3.2.0</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>shade</goal>
                                </goals>
                                <configuration>
                                    <transformers>
                                        <transformer
                                                implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                            <manifestEntries>
                                                <Main-Class>io.vertx.core.Launcher</Main-Class>
                                                <Main-Verticle>com.github.mcollovati.vertx.vaadin.VaadinVerticle
                                                </Main-Verticle>
                                            </manifestEntries>
                                        </transformer>
                                    </transformers>
                                    <artifactSet>
                                        <!--<excludes>*:*</excludes>-->
                                        <includes>com.github.mcollovati.vertx:vaadin-flow-sockjs</includes>
                                    </artifactSet>
                                    <shadedArtifactAttached>true</shadedArtifactAttached>
                                    <shadedClassifierName>full</shadedClassifierName>
                                    <!--
                                    <outputFile>
                                        ${project.build.directory}/${project.artifactId}-${project.version}-fat.jar
                                    </outputFile>
                                    -->
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
