<?xml version="1.0" encoding="UTF-8"?>
<!-- vi: set et smarttab sw=4 tabstop=4: -->
<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>org.opendaylight.controller</groupId>
        <artifactId>commons.opendaylight</artifactId>
        <version>1.4.1</version>
        <relativePath>../commons/opendaylight</relativePath>
    </parent>


    <version>0.2.3</version>
    <artifactId>config-subsystem</artifactId>
    <packaging>pom</packaging>
    <name>${project.artifactId}</name>
    <prerequisites>
        <maven>3.0.4</maven>
    </prerequisites>
    <modules>
        <module>config-api</module>
        <module>config-manager</module>
        <module>config-plugin-parent</module>
        <module>config-util</module>
        <module>config-persister-api</module>
        <module>config-persister-file-adapter</module>
        <module>config-persister-file-xml-adapter</module>
        <module>yang-jmx-generator</module>
        <module>yang-jmx-generator-plugin</module>
        <module>yang-store-api</module>
        <module>yang-store-impl</module>
        <module>yang-test</module>
        <module>logback-config</module>
        <module>threadpool-config-api</module>
        <module>netty-config-api</module>
        <module>threadpool-config-impl</module>
        <module>netty-threadgroup-config</module>
        <module>netty-event-executor-config</module>
        <module>netty-timer-config</module>
        <module>config-persister-directory-adapter</module>
        <module>config-persister-directory-xml-adapter</module>
        <module>config-persister-directory-autodetect-adapter</module>
        <module>yang-test-plugin</module>
        <module>shutdown-api</module>
        <module>shutdown-impl</module>
    </modules>

    <profiles>
      <profile>
        <id>integrationtests</id>
        <activation>
          <activeByDefault>false</activeByDefault>
        </activation>
        <modules>
          <module>yang-jmx-generator-it</module>
        </modules>
      </profile>
    </profiles>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version.source>1.7</java.version.source>
        <java.version.target>1.7</java.version.target>
        <junit.version>4.10</junit.version>
        <maven.bundle.version>2.4.0</maven.bundle.version>
        <osgi.version>5.0.0</osgi.version>
        <jacoco.version>0.6.2.201302030002</jacoco.version>
        <slf4j.version>1.7.2</slf4j.version>
        <salGeneratorPath>${project.build.directory}/generated-sources/sal</salGeneratorPath>
        <config.version>0.2.3</config.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.core</artifactId>
                <version>${osgi.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.4</version>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>14.0.1</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons.lang.version}</version>
            </dependency>

            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>config-api</artifactId>
                <version>${config.version}</version>
            </dependency>

            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>config-util</artifactId>
                <version>${config.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>config-util</artifactId>
                <version>${config.version}</version>
                <type>test-jar</type>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>config-manager</artifactId>
                <version>${config.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>config-manager</artifactId>
                <version>${config.version}</version>
                <type>test-jar</type>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>config-persister-api</artifactId>
                <version>${config.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>config-persister-api</artifactId>
                <version>${config.version}</version>
                <type>test-jar</type>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.yangtools</groupId>
                <artifactId>binding-generator-spi</artifactId>
                <version>${yangtools.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.yangtools</groupId>
                <artifactId>binding-generator-util</artifactId>
                <version>${yangtools.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.yangtools</groupId>
                <artifactId>yang-parser-impl</artifactId>
                <version>${yangtools.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.yangtools</groupId>
                <artifactId>binding-generator-impl</artifactId>
                <version>${yangtools.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>yang-test</artifactId>
                <version>${config.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.controller</groupId>
                <artifactId>yang-jmx-generator</artifactId>
                <version>${config.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.controller</groupId>
                <artifactId>yang-jmx-generator</artifactId>
                <version>${config.version}</version>
                <type>test-jar</type>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.yangtools</groupId>
                <artifactId>binding-type-provider</artifactId>
                <version>${yangtools.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.yangtools</groupId>
                <artifactId>yang-maven-plugin-spi</artifactId>
                <version>${yangtools.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>yang-store-api</artifactId>
                <version>${config.version}</version>
            </dependency>

            <dependency>
                <groupId>org.opendaylight.controller</groupId>
                <artifactId>shutdown-api</artifactId>
                <version>${config.version}</version>
            </dependency>

            <!-- MD-SAL -->
            <dependency>
                <groupId>org.opendaylight.yangtools</groupId>
                <artifactId>yang-binding</artifactId>
                <version>${yangtools.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.yangtools</groupId>
                <artifactId>yang-common</artifactId>
                <version>${yangtools.version}</version>
            </dependency>
            <dependency>
                <groupId>org.opendaylight.yangtools</groupId>
                <artifactId>concepts</artifactId>
                <version>${yangtools.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>


    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>check</goal>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/jacoco</outputDirectory>
                            <haltOnFailure>false</haltOnFailure>
                            <check>
                                <classRatio>80</classRatio>
                            </check>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>


        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.opendaylight.yangtools</groupId>
                    <artifactId>yang-maven-plugin</artifactId>
                    <version>${yangtools.version}</version>
                    <executions>
                        <execution>
                            <id>sal</id>
                            <goals>
                                <goal>generate-sources</goal>
                            </goals>
                            <configuration>
                                <yangFilesRootDir>src/main/yang</yangFilesRootDir>
                                <codeGenerators>
                                    <generator>
                                        <codeGeneratorClass>
                                            org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl
                                        </codeGeneratorClass>
                                        <outputBaseDir>
                                            ${salGeneratorPath}
                                        </outputBaseDir>
                                    </generator>
                                    <generator>
                                        <codeGeneratorClass>org.opendaylight.yangtools.yang.unified.doc.generator.maven.DocumentationGeneratorImpl</codeGeneratorClass>
                                        <outputBaseDir>${project.build.directory}/site/models</outputBaseDir>
                                    </generator>
                                </codeGenerators>
                                <inspectDependencies>true</inspectDependencies>
                            </configuration>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.opendaylight.yangtools</groupId>
                            <artifactId>maven-sal-api-gen-plugin</artifactId>
                            <version>${yangtools.version}</version>
                            <type>jar</type>
                        </dependency>
                    </dependencies>
                </plugin>
                <!-- tell eclipse about generated source folders -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>1.8</version>
                    <executions>
                        <execution>
                            <id>add-source</id>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>add-source</goal>
                            </goals>
                            <configuration>
                                <sources>
                                    <source>${salGeneratorPath}</source>
                                </sources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.4</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>test-jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>${maven.bundle.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <instructions>
                            <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
                        </instructions>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.14.1</version>
                    <configuration>
                        <redirectTestOutputToFile>true</redirectTestOutputToFile>
                        <parallel>classes</parallel>
                        <forkCount>1C</forkCount>
                        <reuseForks>false</reuseForks>
                        <perCoreThreadCount>true</perCoreThreadCount>
                        <threadCount>2</threadCount>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.3</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.groovy.maven</groupId>
                    <artifactId>gmaven-plugin</artifactId>
                    <version>1.0</version>
                </plugin>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.opendaylight.yangtools
                                        </groupId>
                                        <artifactId>
                                            yang-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [0.5.7-SNAPSHOT,)
                                        </versionRange>
                                        <goals>
                                            <goal>
                                                generate-sources
                                            </goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>
