<?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">
    <parent>
        <groupId>ch.codeblock.qrinvoice.rest</groupId>
        <artifactId>qrinvoice-rest</artifactId>
        <version>1.2</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>qrinvoice-rest-model</artifactId>

    <name>QR Invoice REST API - Model</name>

    <licenses>
        <license>
            <name>GNU Affero General Public License v3</name>
            <url>http://www.fsf.org/licensing/licenses/agpl-3.0.html</url>
        </license>
    </licenses>


    <dependencies>
        <dependency>
            <groupId>ch.codeblock.qrinvoice.rest</groupId>
            <artifactId>qrinvoice-rest-tools-generator</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        
        <dependency>
            <groupId>io.swagger</groupId>
            <artifactId>swagger-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generateCode</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>java</goal>
                        </goals>
                        <configuration>
                            <mainClass>ch.codeblock.qrinvoice.tools.generator.RestModelGenerator</mainClass>
                            <arguments>${project.basedir}</arguments>
                            <classpathScope>runtime</classpathScope>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>addtoSourceFolder</id>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <phase>process-sources</phase>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-sources/generation_place</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    
</project>