<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>

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

    <groupId>org.humanistika.oxygen</groupId>
    <artifactId>tei-completer</artifactId>
    <version>1.0.2</version>

    <name>TEI Completer</name>
    <description>An Oxygen XML Editor plugin for customizable attribute and value completion for TEI P5 documents</description>
    <url>https://github.com/BCDH/TEI-Completer</url>
    <inceptionYear>2016</inceptionYear>

    <organization>
        <name>Belgrade Center for Digital Humanities</name>
        <url>http://www.humanistika.org</url>
    </organization>

    <developers>
        <developer>
            <name>Adam Retter</name>
            <organization>Evolved Binary</organization>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>GNU General Public License, version 2</name>
            <url>http://opensource.org/licenses/gpl-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:https://github.com/BCDH/TEI-Completer.git</connection>
        <developerConnection>scm:git:https://github.com/BCDH/TEI-Completer.git</developerConnection>
        <url>scm:git:https://github.com/BCDH/TEI-Completer.git</url>
      <tag>1.0.2</tag>
  </scm>

    <properties>
        <oxygen.sdk.version>17.1.0.2</oxygen.sdk.version>
        <jersey.version>2.22.2</jersey.version>
        <slf4j.version>1.7.16</slf4j.version>
        <jaxb2-basics.version>0.11.0</jaxb2-basics.version>
        <eclipse.persistence.version>2.6.3-M1</eclipse.persistence.version>
        <project.build.source>1.7</project.build.source>
        <project.build.target>1.7</project.build.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <enforce.release.jdk-version>(1.7,1.8)</enforce.release.jdk-version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.oxygenxml</groupId>
            <artifactId>oxygen</artifactId>
            <version>${oxygen.sdk.version}</version>
            <scope>provided</scope>
            <!-- Exclusion only needed if artifactId is "oxygen-sdk" -->
            <!-- We use a newer version of Rhino, we avoid conflicts via the Maven Shade plugin (see below) -->
            <!-- exclusions>
                <exclusion>
                    <groupId>rhino</groupId>
                    <artifactId>js</artifactId>
                </exclusion>
            </exclusions -->
        </dependency>
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations-java5</artifactId>
            <version>15.0</version>
        </dependency>
        <dependency>
            <!-- The newer version of Rhino that we need -->
            <groupId>org.mozilla</groupId>
            <artifactId>rhino</artifactId>
            <version>1.7.7.1</version>
        </dependency>
        <dependency>
            <groupId>net.sf.saxon</groupId>
            <artifactId>Saxon-HE</artifactId>
            <version>9.7.0-1</version>
            <scope>runtime</scope> <!-- provided by Oxygen -->
        </dependency>
        <dependency>
            <groupId>com.evolvedbinary.xpath</groupId>
            <artifactId>xpath2-parser</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>org.eclipse.persistence.moxy</artifactId>
            <version>${eclipse.persistence.version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>org.eclipse.persistence.core</artifactId>
            <version>${eclipse.persistence.version}</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-client</artifactId>
            <version>${jersey.version}</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-common</artifactId>
            <version>${jersey.version}</version>
        </dependency>
        <dependency>
            <!-- needed for both `runtime` scope for `jersey-common` and
            `test` scope for our code. If we don't have this the `test` scope alone
            causes it to be excluded from the shaded Jar -->
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
            <version>1.2</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-jaxb</artifactId>
            <version>${jersey.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-moxy</artifactId>
            <version>${jersey.version}</version>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j.version}</version>
        </dependency>
        <dependency>
            <!-- required for auto-generated equals(Object obj) method in JAXB objects -->
            <groupId>org.jvnet.jaxb2_commons</groupId>
            <artifactId>jaxb2-basics-runtime</artifactId>
            <version>${jaxb2-basics.version}</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${slf4j.version}</version>
            <scope>runtime</scope>
        </dependency> <!-- log4j is provided by Oxygen -->

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.test-framework</groupId>
            <artifactId>jersey-test-framework-core</artifactId>
            <version>${jersey.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.test-framework.providers</groupId>
            <artifactId>jersey-test-framework-provider-inmemory</artifactId>
            <version>${jersey.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- useful for replacing the in-memory provider if you want to trace the network traffic -->
        <!-- dependency>
            <groupId>org.glassfish.jersey.test-framework.providers</groupId>
            <artifactId>jersey-test-framework-provider-grizzly2</artifactId>
            <version>${jersey.version}</version>
            <scope>test</scope>
        </dependency -->
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-server</artifactId>
            <version>${jersey.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- see `compile` scoped `javax.annotation-api` dependency
        above for explanation -->
        <!-- dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
            <version>1.2</version>
            <scope>test</scope>
        </dependency -->
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.10</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>2.11</version>
                <configuration>
                    <header>GPL2-template.txt</header>
                    <failIfMissing>true</failIfMissing>
                    <aggregate>true</aggregate>
                    <strictCheck>true</strictCheck>
                    <properties>
                        <organization>${project.organization.name}</organization>
                    </properties>
                    <excludes>
                        <exclude>**/pom.xml</exclude>
                        <exclude>**/README.md</exclude>
                        <exclude>**/LICENSE</exclude>
                        <exclude>src/main/resources/**</exclude>
                        <exclude>src/test/resources/**</exclude>
                    </excludes>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
                <executions>
                    <execution>
                        <id>check-headers</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb22-plugin</artifactId>
                <version>0.13.1</version>
                <configuration>
                    <extension>true</extension>
                    <args>
                        <arg>-Xequals</arg>
                    </args>
                    <plugins>
                        <plugin>
                            <groupId>org.jvnet.jaxb2_commons</groupId>
                            <artifactId>jaxb2-basics</artifactId>
                            <version>${jaxb2-basics.version}</version>
                        </plugin>
                    </plugins>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.10</version>
                <executions>
                    <execution>
                        <id>analyze</id>
                        <goals>
                            <goal>analyze-only</goal>
                        </goals>
                        <configuration>
                            <failOnWarning>true</failOnWarning>
                            <!-- ignore various runtime dependency warnings -->
                            <ignoredUnusedDeclaredDependencies>
                                <ignoredUnusedDeclaredDependency>net.sf.saxon:Saxon-HE</ignoredUnusedDeclaredDependency>
                                <ignoredUnusedDeclaredDependency>org.glassfish.jersey.test-framework.providers:jersey-test-framework-provider-inmemory</ignoredUnusedDeclaredDependency>
                                <ignoredUnusedDeclaredDependency>org.slf4j:slf4j-log4j12</ignoredUnusedDeclaredDependency>
                                <ignoredUnusedDeclaredDependency>org.glassfish.jersey.media:jersey-media-jaxb</ignoredUnusedDeclaredDependency>
                            </ignoredUnusedDeclaredDependencies>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.code54.mojo</groupId>
                <artifactId>buildversion-plugin</artifactId>
                <version>1.0.3</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>set-properties</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>${project.build.source}</source>
                    <target>${project.build.target}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <compilerArgs>
                        <compilerArg>-Xlint:unchecked</compilerArg>
                        <compilerArg>-Xlint:deprecation</compilerArg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                        <manifestEntries>
                            <Build-Tag>${build-tag}</Build-Tag>
                            <Git-Commit>${build-commit}</Git-Commit>
                            <Git-Commit-Abbrev>${build-commit-abbrev}</Git-Commit-Abbrev>
                            <Build-Version>${build-version}</Build-Version>
                            <Build-Timestamp>${build-tstamp}</Build-Timestamp>
                            <Source-Repository>${project.scm.connection}</Source-Repository>
                            <Description>${project.description}</Description>
                            <Implementation-URL>${project.url}</Implementation-URL>
                            <License>GNU General Public License, version 2</License>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.4.3</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <shadedClassifierName>oxygen-plugin</shadedClassifierName>
                            <relocations>
                                <relocation>
                                    <!-- Oxygen has an older version of Rhino so we relocate our newer version to a different package -->
                                    <pattern>org.mozilla.javascript</pattern>
                                    <shadedPattern>org.humanistika.org.mozilla.javascript.internal</shadedPattern>
                                </relocation>
                            </relocations>
                            <artifactSet>
                                <excludes>
                                    <!-- Oxygen already ships with a version of these, so we needn't package them as well -->
                                    <exclude>log4j:log4j</exclude>
                                    <exclude>net.sf.saxon:Saxon-HE</exclude>
                                </excludes>
                            </artifactSet>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
                                    <addHeader>false</addHeader>
                                </transformer>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
                                    <resource>META-INF/LICENSE</resource>
                                    <file>LICENSE</file>
                                </transformer>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
                                    <resource>META-INF/README.md</resource>
                                    <file>README.md</file>
                                </transformer>
                            </transformers>
                            <filters>
                                <filter>
                                    <artifact>org.eclipse.persistence:*</artifact>
                                    <excludes>
                                        <exclude>*.html</exclude>
                                    </excludes>
                                </filter>
                                <filter>
                                    <artifact>*:*</artifact>
                                    <excludes>
                                        <exclude>META-INF/*.SF</exclude>
                                        <exclude>META-INF/*.DSA</exclude>
                                        <exclude>META-INF/*.RSA</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <!-- Attach source jars -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                        <manifestEntries>
                            <Build-Tag>${build-tag}</Build-Tag>
                            <Git-Commit>${build-commit}</Git-Commit>
                            <Git-Commit-Abbrev>${build-commit-abbrev}</Git-Commit-Abbrev>
                            <Build-Version>${build-version}</Build-Version>
                            <Build-Timestamp>${build-tstamp}</Build-Timestamp>
                            <Source-Repository>${project.scm.connection}</Source-Repository>
                            <Description>${project.description}</Description>
                            <Implementation-URL>${project.url}</Implementation-URL>
                            <License>GNU General Public License, version 2</License>
                        </manifestEntries>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.4.1</version>
                <executions>
                    <execution>
                        <id>enforce-java</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>${enforce.release.jdk-version}</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.5</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <mavenExecutorId>forked-path</mavenExecutorId> <!-- avoid a bug with GPG plugin hanging http://jira.codehaus.org/browse/MGPG-9 -->
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>oxygen</id>
            <name>oXygen public artifacts</name>
            <url>http://www.oxygenxml.com/maven</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>sonatype-releases</id>
            <url>http://oss.sonatype.org/content/repositories/releases</url>
        </pluginRepository>
        <pluginRepository>
            <id>clojars.org</id>
            <url>http://clojars.org/repo</url>
        </pluginRepository>
    </pluginRepositories>

</project>
