<!--

    Copyright (C) 2013 Mycila (mathieu.carbou@gmail.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>

    <groupId>com.mycila</groupId>
    <artifactId>mycila-pom</artifactId>
    <version>3</version>
    <packaging>pom</packaging>

    <name>Mycila POM</name>
    <description>Parent POM</description>
    <inceptionYear>2013</inceptionYear>
    <url>http://mycila.github.io/${mycila.github.name}</url>

    <properties>
        <jdk.version>1.7</jdk.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <osgi.private>com.mycila.${mycila.github.name}.internal</osgi.private>
        <osgi.import>*</osgi.import>
        <osgi.export>!com.mycila.${mycila.github.name}.internal*,com.mycila.${mycila.github.name}*;version="${project.version}";-noimport:=true</osgi.export>
        <mycila.github.name>pom</mycila.github.name>
    </properties>

    <scm>
        <connection>scm:git:https://github.com/mycila/${mycila.github.name}.git</connection>
        <developerConnection>scm:git:git@github.com:mycila/${mycila.github.name}.git</developerConnection>
        <url>http://github.com/mycila/${mycila.github.name}</url>
        <tag>mycila-pom-3</tag>
    </scm>

    <organization>
        <name>Mycila</name>
        <url>http://www.mycila.com/</url>
    </organization>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/mycila/${mycila.github.name}/issues</url>
    </issueManagement>

    <ciManagement>
        <system>Travis</system>
        <url>https://travis-ci.org/mycila/${mycila.github.name}</url>
    </ciManagement>

    <developers>
        <developer>
            <id>mathieucarbou</id>
            <name>Mathieu Carbou</name>
            <email>mathieu.carbou@gmail.com</email>
            <url>https://github.com/mathieucarbou</url>
            <organization>Mycila</organization>
            <organizationUrl>http://mycila.com/</organizationUrl>
            <roles>
                <role>leader</role>
                <role>architect</role>
                <role>developer</role>
            </roles>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <distributionManagement>
        <repository>
            <id>mycila-oss-staging</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>mycila-oss-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <uniqueVersion>false</uniqueVersion>
        </snapshotRepository>
    </distributionManagement>

    <build>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-webdav</artifactId>
                <version>1.0-beta-2</version>
            </extension>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh-external</artifactId>
                <version>2.4</version>
            </extension>
        </extensions>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>1.1.1</version>
                    <configuration>
                        <rules>
                            <requireMavenVersion>
                                <version>(,2.1.0),(2.1.0,2.2.0),(2.2.0,)</version>
                                <message>Maven 2.1.0 and 2.2.0 produce incorrect GPG signatures and checksums respectively.</message>
                            </requireMavenVersion>
                        </rules>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <compilerId>groovy-eclipse-compiler</compilerId>
                        <source>${jdk.version}</source>
                        <target>${jdk.version}</target>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.codehaus.groovy</groupId>
                            <artifactId>groovy-eclipse-compiler</artifactId>
                            <version>2.8.0-01</version>
                        </dependency>
                        <dependency>
                            <groupId>org.codehaus.groovy</groupId>
                            <artifactId>groovy-eclipse-batch</artifactId>
                            <version>2.1.5-03</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-eclipse-compiler</artifactId>
                    <version>2.8.0-01</version>
                    <extensions>true</extensions>
                </plugin>
                <plugin>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.4</version>
                    <configuration>
                        <useAgent>false</useAgent>
                        <keyname>7356EF1B</keyname>
                        <passphrase>${mycila.gpg.passphrase}</passphrase>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.4.1</version>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.4</version>
                    <configuration>
                        <failOnMissingWebXml>false</failOnMissingWebXml>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.2.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.4</version>
                </plugin>
                <plugin>
                    <artifactId>maven-jarsigner-plugin</artifactId>
                    <version>1.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.7</version>
                </plugin>
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.5</version>
                    <configuration>
                        <filesets>
                            <fileset>
                                <directory>${basedir}</directory>
                                <includes>
                                    <include>dependency-reduced-pom.xml</include>
                                    <include>dependency-reduced-pom-*.xml</include>
                                </includes>
                            </fileset>
                        </filesets>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>2.1</version>
                    <configuration>
                        <shadedArtifactAttached>false</shadedArtifactAttached>
                        <createSourcesJar>true</createSourcesJar>
                        <createDependencyReducedPom>true</createDependencyReducedPom>
                        <shadeSourcesContent>true</shadeSourcesContent>
                        <filters>
                            <filter>
                                <artifact>*:*</artifact>
                                <excludes>
                                    <exclude>images/**</exclude>
                                    <exclude>overview.html</exclude>
                                    <exclude>overviewj.html</exclude>
                                    <exclude>about.html</exclude>
                                    <exclude>LICENSE</exclude>
                                    <exclude>NOTICE</exclude>
                                    <exclude>jetty-dir.css</exclude>
                                    <exclude>META-INF/*.RSA</exclude>
                                    <exclude>META-INF/*.SF</exclude>
                                    <exclude>META-INF/*.txt</exclude>
                                    <exclude>META-INF/*.tld</exclude>
                                    <exclude>META-INF/NOTICE</exclude>
                                    <exclude>META-INF/LICENSE</exclude>
                                    <exclude>META-INF/DEPENDENCIES</exclude>
                                    <exclude>META-INF/eclipse.inf</exclude>
                                    <exclude>about_files/**</exclude>
                                    <exclude>module.properties</exclude>
                                    <exclude>plugin.properties</exclude>
                                </excludes>
                            </filter>
                        </filters>
                        <transformers>
                            <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                        </transformers>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.4</version>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>2.2</version>
                    <configuration>
                        <header>com/mycila/licenses/APACHE-2</header>
                        <properties>
                            <owner>Mycila</owner>
                            <year>${project.inceptionYear}</year>
                            <email>mathieu.carbou@gmail.com</email>
                        </properties>
                        <excludes>
                            <exclude>src/test/resources/**</exclude>
                        </excludes>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>com.mycila</groupId>
                            <artifactId>licenses</artifactId>
                            <version>1</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.7</version>
                </plugin>
                <plugin>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.8</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.15</version>
                </plugin>
                <plugin>
                    <groupId>org.eclipse.jetty</groupId>
                    <artifactId>jetty-maven-plugin</artifactId>
                    <version>9.0.4.v20130625</version>
                    <configuration>
                        <stopPort>8090</stopPort>
                        <stopKey>stop</stopKey>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.9.1</version>
                    <configuration>
                        <source>${jdk.version}</source>
                        <encoding>UTF-8</encoding>
                        <maxmemory>1g</maxmemory>
                        <links>
                            <link>http://docs.oracle.com/javase/7/docs/api</link>
                        </links>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>2.3.5</version>
                    <extensions>true</extensions>
                    <executions>
                        <execution>
                            <phase>prepare-package</phase>
                            <goals>
                                <goal>manifest</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <instructions>
                            <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
                            <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                            <Bundle-Name>${project.name}</Bundle-Name>
                            <Bundle-Description>${project.description}</Bundle-Description>
                            <Bundle-Version>${project.version}</Bundle-Version>
                            <Bundle-Vendor>${project.organization.name}</Bundle-Vendor>
                            <Bundle-DocURL>${project.url}</Bundle-DocURL>
                            <Bundle-Copyright>Copyright (C) ${project.inceptionYear} ${project.organization.name}</Bundle-Copyright>
                            <Private-Package>${osgi.private}</Private-Package>
                            <Export-Package>${osgi.export}</Export-Package>
                            <Import-Package>${osgi.import}</Import-Package>
                            <_versionpolicy>[${version;===;${@}},${version;+;${@}})</_versionpolicy>
                            <_removeheaders>
                                Built-By,Tool,Created-By,
                                Include-Resource,Private-Package,
                                Ignore-Package,Bnd-LastModified
                            </_removeheaders>
                        </instructions>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>3.2</version>
                    <configuration>
                        <detail>true</detail>
                        <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
                    </configuration>
                    <executions>
                        <execution>
                            <id>generate-helpmojo</id>
                            <goals>
                                <goal>helpmojo</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>generate-descriptor</id>
                            <goals>
                                <goal>descriptor</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy-eclipse-compiler</artifactId>
                <extensions>true</extensions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>3.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.7</version>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
