<!--
  ~ Copyright 2015 JAXIO http://www.jaxio.com
  ~
  ~ 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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.jaxio.celerio</groupId>
        <artifactId>celerio-parent</artifactId>
        <version>4.0.10</version>
    </parent>

    <artifactId>celerio-engine</artifactId>
    <packaging>jar</packaging>

    <name>celerio-engine</name>
    <description>Celerio Core Generation Engine</description>


    <dependencies>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.persistence</groupId>
            <artifactId>persistence-api</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jibx</groupId>
            <artifactId>jibx-run</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>joda-time</groupId>
                    <artifactId>joda-time</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <!-- spring -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-oxm</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
        </dependency>
        <!-- test scope -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.6</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-jdbc</artifactId>
            <version>7.0.39</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.easytesting</groupId>
            <artifactId>fest-assert</artifactId>
            <scope>test</scope>
        </dependency>


        <!-- code formatting -->
        <!-- more or less same dependencies as in https://code.google.com/p/maven-java-formatter-plugin/source/browse/trunk/pom.xml -->
        <dependency>
            <groupId>org.eclipse.equinox</groupId>
            <artifactId>org.eclipse.equinox.common</artifactId>
            <version>3.6.0</version>
        </dependency>

        <dependency>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>org.eclipse.jdt.core</artifactId>
            <version>3.11.1.v20150902-1521</version>
        </dependency>

        <dependency>
            <groupId>org.eclipse.text</groupId>
            <artifactId>org.eclipse.text</artifactId>
            <version>3.5.101</version>
        </dependency>

        <dependency>
            <groupId>org.eclipse.core</groupId>
            <artifactId>org.eclipse.core.resources</artifactId>
            <version>3.7.100</version>
        </dependency>

        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
        </dependency>
        <!-- tools -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>oro</groupId>
                    <artifactId>oro</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <groupId>com.thoughtworks.xstream</groupId>
            <artifactId>xstream</artifactId>
        </dependency>
        <dependency>
            <groupId>org.codehaus.guessencoding</groupId>
            <artifactId>guessencoding</artifactId>
        </dependency>
        <!-- spring -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-oxm</artifactId>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
        </dependency>
        <!-- aop is set in test scope -->
        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib-nodep</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-instrument</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- test -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.easytesting</groupId>
            <artifactId>fest-assert</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>
    <build>
        <defaultGoal>install</defaultGoal>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.properties</include>
                </includes>
                <excludes>
                    <exclude>**/CVS</exclude>
                    <exclude>**/*.svn</exclude>
                </excludes>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>**/*.properties</exclude>
                    <exclude>**/CVS</exclude>
                    <exclude>**/*.svn</exclude>
                </excludes>
                <filtering>false</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <version>1.2</version>
                <executions>
                    <execution>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <doUpdate>true</doUpdate>
                    <shortRevisionLength>8</shortRevisionLength>
                    <format>Celerio built on {0,date,yyyy-MM-dd} at {0,date,HH:mm:ss} using commit {1}</format>
                    <items>
                        <item>timestamp</item>
                        <item>scmVersion</item>
                    </items>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.2</version>
                <executions>
                    <execution>
                        <id>Celerio creation</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <java fork="true" failonerror="true" classname="org.jibx.binding.generator.BindGen">
                                    <classpath>
                                        <path refid="maven.dependency.classpath" />
                                        <path refid="maven.compile.classpath" />
                                        <path refid="maven.runtime.classpath" />
                                        <path refid="maven.test.classpath" />
                                        <path refid="maven.plugin.classpath" />
                                    </classpath>
                                    <arg value="-t" />
                                    <arg value="${project.build.directory}/jibx" />
                                    <arg value="-c" />
                                    <arg value="${basedir}/src/main/config/customization.xml" />
                                    <arg value="-s" />
                                    <arg value="${basedir}/src/main/java/" />
                                    <arg value="com.jaxio.celerio.configuration.Celerio" />
                                    <arg value="com.jaxio.celerio.configuration.database.Metadata" />
                                    <arg value="com.jaxio.celerio.configuration.eclipse.Profiles" />
                                    <arg value="com.jaxio.celerio.configuration.pack.CelerioPack" />
                                </java>
                                <echo file="${project.build.outputDirectory}/release.properties"><![CDATA[release.info=${buildNumber}
relase.by=${user.name}]]></echo>
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>log4j</groupId>
                        <artifactId>log4j</artifactId>
                        <version>1.2.13</version>
                    </dependency>
                    <dependency>
                        <groupId>org.jibx</groupId>
                        <artifactId>jibx-bind</artifactId>
                        <version>${jibx.version}</version>
                        <exclusions>
                            <exclusion>
                                <groupId>bcel</groupId>
                                <artifactId>bcel</artifactId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                    <dependency>
                        <!-- TODO: workaround while waiting for BCEL 6.0; -->
                        <groupId>com.google.code.findbugs</groupId>
                        <artifactId>bcel-findbugs</artifactId>
                        <version>6.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.jibx</groupId>
                        <artifactId>jibx-tools</artifactId>
                        <version>${jibx.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.jibx</groupId>
                        <artifactId>jibx-run</artifactId>
                        <version>${jibx.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.jibx</groupId>
                        <artifactId>jibx-extras</artifactId>
                        <version>${jibx.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>com.thoughtworks.qdox</groupId>
                        <artifactId>qdox</artifactId>
                        <version>1.10</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.jibx</groupId>
                <artifactId>maven-jibx-plugin</artifactId>
                <version>${jibx.version}</version>
                <executions>
                    <execution>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>bind</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.jibx</groupId>
                        <artifactId>jibx-bind</artifactId>
                        <version>${jibx.version}</version>
                        <exclusions>
                            <exclusion>
                                <groupId>bcel</groupId>
                                <artifactId>bcel</artifactId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                    <dependency>
                        <!-- TODO: workaround while waiting for BCEL 6.0; -->
                        <groupId>com.google.code.findbugs</groupId>
                        <artifactId>bcel-findbugs</artifactId>
                        <version>6.0</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <directory>target/jibx</directory>
                </configuration>
            </plugin>
            <!-- copy jibx classes' path so it we can use it from bootstrap -->
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/classes/jibx</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.build.directory}/jibx</directory>
                                    <filtering>false</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <forkMode>once</forkMode>
                    <argLine>
                        <![CDATA[-Xmx512m "-javaagent:${settings.localRepository}/org/springframework/spring-instrument/${spring.version}/spring-instrument-${spring.version}.jar"]]></argLine>
                    <!--<useSystemClassloader>true</useSystemClassloader>-->
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <archive>
                        <index>true</index>
                        <manifest>
                            <addDefaultImplementationEntries>true
                            </addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true
                            </addDefaultSpecificationEntries>
                        </manifest>
                        <manifestEntries>
                            <Build-Os>${os.name}</Build-Os>
                            <Build-Os-Version>${os.version}</Build-Os-Version>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
