<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You 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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.oasis-open.contextserver</groupId>
    <artifactId>context-server</artifactId>
    <name>Context Server root project</name>
    <version>1.0.0</version>
    <packaging>pom</packaging>
    <inceptionYear>2014</inceptionYear>
    <organization>
        <name>Jahia Solutions</name>
        <url>http://www.jahia.com</url>
    </organization>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <cxf.version>2.7.11</cxf.version>
        <version.jackson.core>2.4.0</version.jackson.core> <!-- version used by CXF -->
        <version.jackson.jaxb>2.4.0</version.jackson.jaxb> <!-- version used by CXF -->
        <version.karaf>3.0.2</version.karaf>
        <version.pax.exam>4.4.0</version.pax.exam>
		<jahia.plugin.version>4.3</jahia.plugin.version>
    </properties>

    <scm>
        <connection>scm:git:git@github.com:Jahia/unomi.git</connection>
        <url>https://github.com/Jahia/unomi</url>
        <developerConnection>scm:git:git@github.com:Jahia/unomi.git</developerConnection>
        <tag>1_0_0</tag>
  </scm>

    <distributionManagement>
        <repository>
            <id>jahia-releases</id>
            <url>https://devtools.jahia.com/nexus/content/repositories/jahia-releases</url>
        </repository>
        <snapshotRepository>
            <id>jahia-snapshots</id>
            <url>https://devtools.jahia.com/nexus/content/repositories/jahia-snapshots</url>
        </snapshotRepository>
    </distributionManagement>


    <repositories>
        <repository>
            <id>jahia-public</id>
            <name>Jahia Public Repository</name>
            <url>https://devtools.jahia.com/nexus/content/groups/public</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>jahia-public</id>
            <name>Jahia Public Repository</name>
            <url>https://devtools.jahia.com/nexus/content/groups/public</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <profiles>
        <profile>
            <id>integration-tests</id>
            <modules>
                <module>itests</module>
            </modules>
        </profile>

        <profile>
            <id>performance-tests</id>
            <modules>
                <module>performance-tests</module>
            </modules>
        </profile>

        <profile>
            <id>generate-package</id>
            <modules>
                <module>package</module>
            </modules>
        </profile>

        <profile>
            <id>checkstyle</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <version>2.13</version>
                        <executions>
                            <execution>
                                <id>verify-style</id>
                                <phase>process-classes</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <consoleOutput>true</consoleOutput>
                            <failsOnError>true</failsOnError>
                            <logViolationsToConsole>true</logViolationsToConsole>
                            <checkstyleRules>
                                <module name="Checker">
                                    <module name="TreeWalker">
                                        <module name="JavadocType" />
                                        <module name="JavadocMethod">
                                            <property name="scope" value="public" />
                                            <property name="allowMissingPropertyJavadoc" value="true" />
                                        </module>
                                        <module name="UnusedImports" />
                                        <module name="ConstantName">
                                            <property name="applyToProtected" value="false" />
                                            <property name="applyToPackage" value="false" />
                                            <property name="applyToPrivate" value="false" />
                                        </module>
                                        <module name="EmptyBlock">
                                            <property name="option" value="text" />
                                        </module>
                                        <module name="NeedBraces" />
                                        <module name="EqualsHashCode" />
                                        <module name="MagicNumber">
                                            <property name="ignoreNumbers" value=" -1, 0, 1, 2, 3, 17, 24, 31, 37, 60, 255, 256, 1000" />
                                        </module>
                                        <module name="SimplifyBooleanReturn" />
                                        <module name="IllegalCatch">
                                            <property name="illegalClassNames" value=" java.lang.Throwable" />
                                        </module>
                                        <module name="MultipleVariableDeclarations" />
                                        <module name="OneStatementPerLine" />
                                        <module name="RedundantModifier" />
                                    </module>
                                </module>
                            </checkstyleRules>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>update-licenses</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <version>1.8</version>
                        <configuration>
                            <verbose>false</verbose>
                            <addSvnKeyWords>true</addSvnKeyWords>
                            <licenseName>apache_v2</licenseName>
                        </configuration>
                        <executions>
                            <execution>
                                <id>first</id>
                                <goals>
                                    <goal>update-file-header</goal>
                                </goals>
                                <phase>process-sources</phase>
                                <configuration>
                                    <excludes>
                                        <exclude>**/*.json</exclude>
                                        <exclude>**/beans.xml</exclude>
                                    </excludes>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <modules>
        <module>api</module>
        <module>persistence-spi</module>
        <module>persistence-elasticsearch</module>
        <module>services</module>
        <module>rest</module>
        <module>wab</module>
        <module>plugins</module>
        <module>lists-extension</module>
        <module>geonames</module>
        <module>kar</module>
    </modules>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.1</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.jahia.server</groupId>
                    <artifactId>jahia-maven-plugin</artifactId>
                    <version>${jahia.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>2.5.3</version>
                    <configuration>
                        <instructions>
                            <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
                        </instructions>
                    </configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<version>2.5.3</version>
					<configuration>
						<autoVersionSubmodules>true</autoVersionSubmodules>
						<preparationGoals>clean install</preparationGoals>
						<releaseProfiles>integration-tests,performance-tests,generate-package</releaseProfiles>
					</configuration>
				</plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
            </plugin>
        </plugins>

    </build>

</project>
