<?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">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>

    <groupId>org.wisdom-framework</groupId>
    <artifactId>wisdom-framework</artifactId>
    <version>0.7.0</version>

    <packaging>pom</packaging>
    <name>wisdom-framework-project</name>
    <description>Wisdom is a web framework and integration platform for Java, enabling modularity and
        dynamism.
    </description>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>

    <properties>
        <netty.version>4.0.23.Final</netty.version>
        <chameleon.version>1.10.3</chameleon.version>
        <!-- the version of iPOJO included in Chameleon -->
        <ipojo.version>1.12.1</ipojo.version>
        <slf4j.version>1.7.9</slf4j.version>

        <osgi.version>5.0.0</osgi.version>

        <surefire.version>2.18</surefire.version>
        <failsafe.version>2.18</failsafe.version>

        <junit.version>4.12</junit.version>
        <assertj.version>1.7.0</assertj.version>
        <fluentlenium.version>0.10.3</fluentlenium.version>

        <!-- Apache Commons Version -->
        <commons.codec.version>1.10</commons.codec.version>
        <commons.io.version>2.4</commons.io.version>
        <commons.logging.version>1.1.3</commons.logging.version>
        <commons.lang.version>2.6</commons.lang.version>

        <joda.version>2.6</joda.version>
        <guava.version>18.0</guava.version>
        <hocon.version>1.2.1</hocon.version>

        <jackson.version>2.4.4</jackson.version>
        <akka.version>2.2.3</akka.version>
        <hibernateValidator.version>5.1.0.Final</hibernateValidator.version>
        <validation.api.version>1.1.0.Final</validation.api.version>

        <httpclient.version>4.3.4</httpclient.version>
        <httpcore.version>4.3.2</httpcore.version>
        <httpclient.async.version>4.0.1</httpclient.async.version>

        <jsoup.version>1.7.3</jsoup.version>
        <mockito.version>1.10.17</mockito.version>

        <disableLint><!-- only used on jdk8 (see profile) --></disableLint>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- Sonar -->
        <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
        <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
        <sonar.language>java</sonar.language>
    </properties>

    <scm>
        <url>https://github.com/wisdom-framework/wisdom/</url>
        <connection>scm:git:git@github.com:wisdom-framework/wisdom.git</connection>
        <developerConnection>scm:git:git@github.com:wisdom-framework/wisdom.git</developerConnection>
    </scm>

    <inceptionYear>2013</inceptionYear>

    <issueManagement>
        <system>github</system>
        <url>https://github.com/wisdom-framework/wisdom/issues</url>
    </issueManagement>

    <organization>
        <name>Wisdom Framework</name>
        <url>http://wisdom-framework.org</url>
    </organization>

    <profiles>
        <profile>
            <!-- Base components -->
            <id>core</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <jdk>1.8</jdk>
            </activation>
            <modules>
                <module>core/wisdom-api</module>
                <module>core/wisdom-maven-plugin</module>
                <module>core/wisdom-test</module>
                <module>core/wisdom-ipojo-module</module>

                <module>core/wisdom-vertx-engine</module>
                <module>core/application-configuration</module>
                <module>core/content-manager</module>
                <module>core/router</module>
                <module>core/crypto</module>
                <module>core/akka-system</module>
                <module>core/wisdom-base-runtime</module>
            </modules>
        </profile>
        <profile>
            <!-- All other components -->
            <id>framework</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <jdk>1.8</jdk>
            </activation>
            <modules>
                <!-- Full Runtime -->
                <module>framework/resource-controller</module>
                <module>framework/i18n-service</module>
                <module>framework/thymeleaf-template-engine</module>
                <module>framework/default-error-handler</module>
                <module>framework/ehcache-cache-service</module>
                <module>framework/hibernate-validation-service</module>
                <module>framework/wisdom-runtime</module>
                <module>framework/wisdom-bom</module>
                <module>framework/integration-tests</module>
                <module>framework/wisdom-maven-plugin-it</module>
            </modules>
        </profile>
        <profile>
            <!-- All other components -->
            <id>documentation</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <jdk>1.8</jdk>
            </activation>
            <modules>
                <module>documentation/documentation</module>
                <module>documentation/samples</module>
            </modules>
        </profile>
        <profile>
            <!-- All other components -->
            <id>extensions</id>
            <activation>
                <activeByDefault>true</activeByDefault>
                <jdk>1.8</jdk>
            </activation>
            <modules>
                <module>extensions/wisdom-markdown-maven-plugin</module>
                <module>extensions/wisdom-npm-runner-maven-plugin</module>
                <module>extensions/wisdom-asciidoc-maven-plugin</module>
                <module>extensions/wisdom-monitor</module>
                <module>extensions/wisdom-filters</module>
                <module>extensions/wisdom-default-project-archetype</module>
                <module>extensions/wisdom-simple-watcher-archetype</module>
            </modules>
        </profile>
        <profile>
            <!-- JDK 8 is a bit picky on the javadoc, this profile disable the linter -->
            <id>jdk8</id>
            <activation>
                <jdk>1.8</jdk>
            </activation>
            <properties>
                <disableLint>-Xdoclint:none</disableLint>
            </properties>
        </profile>

        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <phase>verify</phase>
                            </execution>
                        </executions>
                        <configuration>
                            <passphrase>${gpg.passphrase}</passphrase>
                            <useAgent>true</useAgent>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.2.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.9.1</version>
                        <executions>
                            <execution>
                                <id>attach-javadoc</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- We need to create a zip containing a buildable version of the project -->
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.apache.resources</groupId>
                                <artifactId>apache-source-release-assembly-descriptor</artifactId>
                                <version>1.0.4</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>source-release-assembly</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                                <configuration>
                                    <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
                                    <descriptorRefs>
                                        <descriptorRef>source-release</descriptorRef>
                                    </descriptorRefs>
                                    <tarLongFileMode>gnu</tarLongFileMode>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>


    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>2.4.0</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-ipojo-plugin</artifactId>
                    <version>${ipojo.version}</version>
                </plugin>

                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.6</version>
                </plugin>

                <plugin>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.8</version>
                </plugin>

                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.4</version>
                </plugin>

                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                </plugin>

                <plugin>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${failsafe.version}</version>
                </plugin>

                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.1</version>
                </plugin>

                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.9.1</version>
                    <configuration>
                        <additionalparam>${disableLint}</additionalparam>
                        <show>private</show>
                        <aggregate>true</aggregate>
                        <groups>
                            <group>
                                <title>Wisdom Runtime Packages</title>

                                <packages>
                                    org.wisdom.api*:org.wisdom.akka*:org.wisdom.configuration*:org.wisdom.content*:org.wisdom.crypto*:org.wisdom.error:org.wisdom.cache.ehcache*:org.wisdom.validation.hibernate*:org.wisdom.i18n:org.wisdom.resources*:org.wisdom.router*:org.wisdom.template.thymeleaf*:org.wisdom.framework.vertx*:org.wisdom.framework.filters
                                </packages>
                            </group>
                            <group>
                                <title>Wisdom Tests and Maven Plugin Packages</title>
                                <packages>org.wisdom.maven*:org.wisdom.test*</packages>
                            </group>
                            <group>
                                <title>Wisdom Extensions</title>
                                <packages>org.wisdom.markdown.asciidoc</packages>
                            </group>
                        </groups>
                        <excludePackageNames>controllers*:interceptors*:ognl:com.jolbox.bonecp:org.wisdom
                            .samples*:tasks
                        </excludePackageNames>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <id>update-headers</id>
                        <goals>
                            <goal>update-file-header</goal>
                        </goals>
                        <phase>process-sources</phase>
                        <configuration>
                            <licenseName>apache_v2</licenseName>
                            <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
                            <projectName>Wisdom-Framework</projectName>
                            <roots>
                                <root>src/main/java</root>
                                <root>src/main/resources</root>
                                <root>src/main/assembly</root>
                                <root>src/test/java</root>
                                <root>src/site</root>
                                <root>src/main/templates</root>
                                <root>target/generated-sources</root>
                                <root>target/processed-sources</root>
                                <!-- do not include test resources -->
                                <!-- do not include external assets -->
                            </roots>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.3.1</version>
                <executions>
                    <execution>
                        <id>enforce-firefox-in-path</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <evaluateBeanshell>
                                    <!-- Check whether firefox is accessible -->
                                    <message>Cannot find 'firefox' in your System Path, check
                                        https://github.com/wisdom-framework/wisdom/wiki/Why-Firefox-is-required-to-build-Wisdom.
                                    </message>
                                    <condition>
                                        //MacOS X case
                                        mac = new File("/Applications/Firefox.app/Contents/MacOS/firefox");
                                        if (mac.isFile()) { return true;}

                                        // Linux and Windows
                                        candidates = new String[] { "firefox", "firefox.exe"};
                                        systemPath = System.getenv("PATH");
                                        if (systemPath == null) { return false; }
                                        pathDirs = systemPath.split(java.io.File.pathSeparator);

                                        for (pathDir : pathDirs) {
                                        for (candidate : candidates) {
                                        file = new java.io.File(pathDir, candidate);
                                        if (file.isFile()) { return true; }
                                        if(file.getName().equals(candidate)) { return true; }
                                        }
                                        }
                                        return false;
                                    </condition>
                                </evaluateBeanshell>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-transport</artifactId>
                <version>${netty.version}</version>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-transport-sctp</artifactId>
                <version>${netty.version}</version>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-handler</artifactId>
                <version>${netty.version}</version>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-codec-http</artifactId>
                <version>${netty.version}</version>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-codec-socks</artifactId>
                <version>${netty.version}</version>
            </dependency>

            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>

            <dependency>
                <groupId>org.fluentlenium</groupId>
                <artifactId>fluentlenium-core</artifactId>
                <version>${fluentlenium.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.fluentlenium</groupId>
                <artifactId>fluentlenium-assertj</artifactId>
                <version>${fluentlenium.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-all</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.felix</groupId>
                <artifactId>org.apache.felix.ipojo.annotations</artifactId>
                <version>${ipojo.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.felix</groupId>
                <artifactId>org.apache.felix.ipojo</artifactId>
                <version>${ipojo.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.enterprise</artifactId>
                <version>${osgi.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.compendium</artifactId>
                <version>${osgi.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.core</artifactId>
                <version>${osgi.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>${joda.version}</version>
            </dependency>

            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons.io.version}</version>
            </dependency>
            <dependency>
                <groupId>com.typesafe</groupId>
                <artifactId>config</artifactId>
                <version>${hocon.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-codec</groupId>
                <artifactId>commons-codec</artifactId>
                <version>${commons.codec.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>${commons.logging.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-lang</groupId>
                <artifactId>commons-lang</artifactId>
                <version>${commons.lang.version}</version>
            </dependency>

            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-xml</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.module</groupId>
                <artifactId>jackson-module-jaxb-annotations</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.woodstox</groupId>
                <artifactId>woodstox-core-asl</artifactId>
                <version>4.4.1</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.woodstox</groupId>
                <artifactId>stax2-api</artifactId>
                <version>3.1.4</version>
            </dependency>

            <dependency>
                <groupId>com.typesafe.akka</groupId>
                <artifactId>akka-osgi_2.10</artifactId>
                <version>${akka.version}</version>
            </dependency>

            <dependency>
                <groupId>javax.validation</groupId>
                <artifactId>validation-api</artifactId>
                <version>${validation.api.version}</version>
            </dependency>

            <dependency>
                <groupId>org.ow2.chameleon</groupId>
                <artifactId>chameleon-core</artifactId>
                <version>${chameleon.version}</version>
            </dependency>

            <dependency>
                <groupId>org.ow2.chameleon</groupId>
                <artifactId>chameleon-core</artifactId>
                <version>${chameleon.version}</version>
                <type>zip</type>
            </dependency>

            <dependency>
                <groupId>org.ow2.chameleon</groupId>
                <artifactId>chameleon-core</artifactId>
                <version>${chameleon.version}</version>
                <classifier>equinox</classifier>
                <type>zip</type>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <repositories>
        <repository>
            <id>oss-snapshot</id>
            <name>oss-snapshot</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        </repository>
    </repositories>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <reportSets>
                    <reportSet>
                        <id>aggregate</id>
                        <inherited>false</inherited>
                        <!-- don't run aggregate in child modules -->
                        <reports>
                            <report>aggregate</report>
                        </reports>
                    </reportSet>
                    <reportSet><!-- by default, id = "default" -->
                        <reports><!-- select non-aggregate reports -->
                            <report>javadoc</report>
                        </reports>
                    </reportSet>
                </reportSets>
                <configuration>
                    <additionalparam>${disableLint}</additionalparam>
                    <show>private</show>
                    <aggregate>true</aggregate>
                    <groups>
                        <group>
                            <title>Wisdom Runtime Packages</title>

                            <packages>
                                org.wisdom.api*:org.wisdom.akka:org.wisdom.configuration:org.wisdom.content*:org.wisdom.crypto*:org.wisdom.error:org.wisdom.cache.ehcache:org.wisdom.validation.hibernate:org.wisdom.i18n:org.wisdom.resources:org.wisdom.router:org.wisdom.template.thymeleaf:org.wisdom.engine*
                            </packages>
                        </group>
                        <group>
                            <title>Wisdom Tests and Maven Plugin Packages</title>
                            <packages>org.wisdom.maven*, org.wisdom.test*</packages>
                        </group>
                        <group>
                            <title>Wisdom Extensions</title>
                            <packages>org.wisdom.markdown.asciidoc</packages>
                        </group>
                    </groups>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

</project>
