<!--

    Copyright 2016 Goldman Sachs.

    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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.goldmansachs.jdmn</groupId>
        <artifactId>jdmn-parent</artifactId>
        <version>1.2.0</version>
    </parent>

    <properties>
        <dmn.version>1.1</dmn.version>
        <dmn.schema>${project.basedir}/src/main/resources/dmn/${dmn.version}/dmn.xsd</dmn.schema>
        <tck.schema>${project.basedir}/src/main/resources/tck/testCases.xsd</tck.schema>

        <jaxb.version>2.2</jaxb.version>
        <jaxb.generated.dmn>${project.basedir}/target/generated-sources/jaxb</jaxb.generated.dmn>
        <jaxb.generated.tck>${project.basedir}/target/generated-sources/jaxb</jaxb.generated.tck>

        <antlr4.version>4.7.1</antlr4.version>
        <antlr.source.directory>${project.basedir}/src/main/resources/dmn/${dmn.version}</antlr.source.directory>
        <antlr.generated>${project.basedir}/target/generated-sources/antlrv4</antlr.generated>
        <antlr.target.directory>${antlr.generated}/com/gs/dmn/feel/analysis/syntax/antlrv4</antlr.target.directory>
    </properties>

    <artifactId>jdmn-core</artifactId>
	<name>jDMN: Core</name>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>com.googlecode.jaxb-namespaceprefixmapper-interfaces</groupId>
            <artifactId>JAXBNamespacePrefixMapper</artifactId>
            <version>2.2.4</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.freemarker</groupId>
            <artifactId>freemarker</artifactId>
            <version>2.3.23</version>
        </dependency>

        <dependency>
            <groupId>org.antlr</groupId>
            <artifactId>antlr4</artifactId>
            <version>${antlr4.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

        <dependency>
            <groupId>org.reflections</groupId>
            <artifactId>reflections</artifactId>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
        </dependency>

        <dependency>
            <groupId>net.sf.saxon</groupId>
            <artifactId>Saxon-HE</artifactId>
            <version>9.7.0-8</version>
        </dependency>

        <dependency>
            <groupId>org.skyscreamer</groupId>
            <artifactId>jsonassert</artifactId>
        </dependency>

        <dependency>
            <groupId>org.fitnesse</groupId>
            <artifactId>fitnesse</artifactId>
            <version>20180127</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>3.2.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.javassist</groupId>
            <artifactId>javassist</artifactId>
            <version>3.21.0-GA</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.google.googlejavaformat</groupId>
            <artifactId>google-java-format</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${jaxb.generated.dmn}</directory>
                            <directory>${jaxb.generated.tck}</directory>
                            <directory>${antlr.generated}</directory>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxb2-maven-plugin</artifactId>
                <version>${jaxb.version}</version>
                <executions>
                    <execution>
                        <id>dmn</id>
                        <configuration>
                            <sources>
                                <source>${dmn.schema}</source>
                            </sources>
                            <outputDirectory>${jaxb.generated.dmn}</outputDirectory>
                            <clearOutputDir>false</clearOutputDir>
                            <noPackageLevelAnnotations>false</noPackageLevelAnnotations>
                            <packageName>org.omg.spec.dmn._20151101.dmn</packageName>
                            <encoding>UTF-8</encoding>
                        </configuration>
                        <goals>
                            <goal>xjc</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>tck</id>
                        <configuration>
                            <sources>
                                <source>${tck.schema}</source>
                            </sources>
                            <outputDirectory>${jaxb.generated.tck}</outputDirectory>
                            <clearOutputDir>false</clearOutputDir>
                            <noPackageLevelAnnotations>false</noPackageLevelAnnotations>
                            <packageName>org.omg.dmn.tck.marshaller._20160719</packageName>
                        </configuration>
                        <goals>
                            <goal>xjc</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.antlr</groupId>
                <artifactId>antlr4-maven-plugin</artifactId>
                <version>${antlr4.version}</version>
                <executions>
                    <execution>
                        <configuration>
                            <sourceDirectory>${antlr.source.directory}</sourceDirectory>
                            <outputDirectory>${antlr.target.directory}</outputDirectory>
                            <listener>false</listener>
                            <visitor>false</visitor>
                        </configuration>
                        <goals>
                            <goal>antlr4</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${jaxb.generated.dmn}</source>
                                <source>${jaxb.generated.tck}</source>
                                <source>${antlr.generated}</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>