<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright © 2017 Ivar Grimstad (ivar.grimstad@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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>javax.mvc</groupId>
    <artifactId>javax.mvc-api</artifactId>
    <version>1.0-pr</version>
    <packaging>bundle</packaging>
    <name>MVC ${project.version} API</name>
    <description>MVC ${project.version} API</description>
    <url>https://www.mvc-spec.org/</url>
    <organization>
        <name>Ivar Grimstad</name>
        <url>https://www.mvc-spec.org/</url>
    </organization>
    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <id>ivargrimstad</id>
            <email>ivar.grimstad@gmail.com</email>
            <name>Ivar Grimstad</name>
            <timezone>CET</timezone>
        </developer>
        <developer>
            <id>chkal</id>
            <email>christian@kaltepoth.de</email>
            <name>Christian Kaltepoth</name>
            <timezone>CET</timezone>
        </developer>
    </developers>
    <issueManagement>
        <system>github</system>
        <url>https://github.com/mvc-spec/mvc-spec/issues</url>
    </issueManagement>
    <mailingLists>
        <mailingList>
            <name>JSR371 Expert Group List</name>
            <archive>jsr371-experts@googlegroups.com</archive>
        </mailingList>
        <mailingList>
            <name>MVC Specification Users List</name>
            <archive>jsr371-users@googlegroups.com</archive>
        </mailingList>
    </mailingLists>
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
    <properties>
        <api_package>javax.mvc</api_package>
        <spec_version>1.0</spec_version>
        <spec_impl_version>${project.version}</spec_impl_version>
        <packages.export>javax.mvc.*</packages.export>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.glassfish.build</groupId>
                <artifactId>spec-version-maven-plugin</artifactId>
                <version>1.2</version>
                <configuration>
                    <spec>
                        <nonFinal>true</nonFinal>
                        <jarType>api</jarType>
                        <specVersion>0.0</specVersion>
                        <newSpecVersion>${spec_version}</newSpecVersion>
                        <specBuild>01</specBuild>
                        <specImplVersion>${spec_impl_version}</specImplVersion>
                        <apiPackage>${api_package}</apiPackage>
                    </spec>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>set-spec-properties</goal>
                            <goal>check-module</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <useIncrementalCompilation>false</useIncrementalCompilation>
                    <showWarnings>true</showWarnings>
                    <compilerArgs>
                        <arg>-Xlint:serial</arg>
                        <arg>-Werror</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.4</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <doctitle>MVC ${project.version} API</doctitle>
                    <windowtitle>MVC ${project.version} API</windowtitle>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.8</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <configuration>
                            <target>
                              <copy file="../spec/target/generated-docs/spec.pdf" tofile="${project.build.directory}/pdf/spec.pdf" overwrite="yes" />
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.9.1</version>
                <executions>
                    <execution>
                        <id>attach-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>${project.build.directory}/pdf/spec.pdf</file>
                                    <type>pdf</type>
                                    <classifier>spec</classifier>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <threshold>High</threshold>
                    <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
                </configuration>
            </plugin>
            <!--
             This plugin is reponsible for packaging artifacts
             as OSGi bundles.  Please refer to
             http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html
             for more information about how to use this plugin.
            -->
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>3.0.1</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-Version>${spec.bundle.version}</Bundle-Version>
                        <Bundle-SymbolicName>${spec.bundle.symbolic-name}</Bundle-SymbolicName>
                        <Extension-Name>${spec.extension.name}</Extension-Name>
                        <Implementation-Version>${spec.implementation.version}</Implementation-Version>
                        <Specification-Version>${spec.specification.version}</Specification-Version>
                        <Export-Package>${packages.export}</Export-Package>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</header>
                    <properties>
                        <owner>Ivar Grimstad</owner>
                        <email>ivar.grimstad@gmail.com</email>
                        <project.inceptionYear>2017</project.inceptionYear>
                    </properties>
                    <includes>
                        <include>src/**/*.java</include>
                        <include>findbugs-exclude.xml</include>
                        <include>pom.xml</include>
                    </includes>
                    <mapping>
                        <java>SLASHSTAR_STYLE</java>
                    </mapping>
                </configuration>
                <executions>
                    <execution>
                        <id>license-check</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>4.0.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>2.0.0.Final</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
            <version>1.3.1</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <profiles>
        <profile>
            <id>jacoco</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.7.2.201409121644</version>
                        <executions>
                            <execution>
                                <id>default-instrument</id>
                                <goals>
                                    <goal>instrument</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>default-restore-instrumented-classes</id>
                                <goals>
                                    <goal>restore-instrumented-classes</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>1.8</version>
                        <executions>
                            <execution>
                                <phase>prepare-package</phase>
                                <configuration>
                                    <target>
                                        <copy todir="${project.build.directory}//generated-classes/jacoco">
                                            <fileset dir="${project.build.directory}/classes">
                                                <exclude name="**/*.class" />
                                            </fileset>
                                        </copy>
                                    </target>
                                </configuration>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <version>2.5</version>
                        <executions>
                            <execution>
                                <id>jacoco-instrumented</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <classifier>instrumented</classifier>
                                    <classesDirectory>${project.build.directory}/generated-classes/jacoco</classesDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>performRelease</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>3.4</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <threshold>High</threshold>
                    <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
                </configuration>
            </plugin>        
        </plugins>
    </reporting>
    <scm>
        <connection>scm:git:https://github.com/mvc-spec/mvc-spec.git</connection>
        <developerConnection>scm:git:https://github.com/mvc-spec/mvc-spec.git</developerConnection>
        <url>https://github.com/mvc-spec/mvc-spec</url>
    </scm>
</project>
