<?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>com.io7m.jstructural</groupId>
    <artifactId>io7m-jstructural</artifactId>
    <version>4.2.0</version>
  </parent>
  <artifactId>io7m-jstructural-maven-plugin</artifactId>

  <packaging>maven-plugin</packaging>
  <name>${project.artifactId}</name>
  <description>Java implementation of the structural document language (Maven plugin)</description>
  <url>http://io7m.github.com/jstructural/</url>

  <scm>
    <url>${project.parent.scm.url}</url>
    <connection>${project.parent.scm.connection}</connection>
    <developerConnection>${project.parent.scm.developerConnection}</developerConnection>
  </scm>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>io7m-jstructural-core</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>io7m-jstructural-xom</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>io7m-jstructural-tools</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>2.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>3.4</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <!-- Produce jar files -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.6</version>
        <executions>
          <!-- Produce custom manifest in jar files -->
          <execution>
            <id>default-jar</id>
            <configuration>
              <archive>
                <manifestEntries>
                  <Specification-Title>${project.name}</Specification-Title>
                  <Specification-Version>${project.version}</Specification-Version>
                  <Specification-Vendor>io7m.com</Specification-Vendor>
                  <Implementation-Title>${project.name}</Implementation-Title>
                  <Implementation-Version>${project.version}</Implementation-Version>
                  <Implementation-Vendor>io7m.com</Implementation-Vendor>
                  <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
                  <Built-By>io7m</Built-By>
                  <Sealed>true</Sealed>
                </manifestEntries>
              </archive>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Create source jar -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>jar-no-fork</goal>
              <goal>test-jar-no-fork</goal>
            </goals>
            <configuration>
              <archive>
                <manifestEntries>
                  <Specification-Title>${project.name}</Specification-Title>
                  <Specification-Version>${project.version}</Specification-Version>
                  <Specification-Vendor>io7m.com</Specification-Vendor>
                  <Implementation-Title>${project.name}</Implementation-Title>
                  <Implementation-Version>${project.version}</Implementation-Version>
                  <Implementation-Vendor>io7m.com</Implementation-Vendor>
                  <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
                  <Built-By>io7m</Built-By>
                </manifestEntries>
              </archive>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Create javadoc jar -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.10.3</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <show>private</show>
              <tagletArtifacts>
                <tagletArtifact>
                  <groupId>org.apache.maven.plugin-tools</groupId>
                  <artifactId>maven-plugin-tools-javadoc</artifactId>
                  <version>3.4</version>
                </tagletArtifact>
              </tagletArtifacts>
              <bottom><![CDATA[Copyright &#169; {currentYear} &lt;code@io7m.com&gt; http://io7m.com]]></bottom>
              <archive>
                <manifestEntries>
                  <Specification-Title>${project.name}</Specification-Title>
                  <Specification-Version>${project.version}</Specification-Version>
                  <Specification-Vendor>io7m.com</Specification-Vendor>
                  <Implementation-Title>${project.name}</Implementation-Title>
                  <Implementation-Version>${project.version}</Implementation-Version>
                  <Implementation-Vendor>io7m.com</Implementation-Vendor>
                  <Implementation-Vendor-Id>${project.groupId}</Implementation-Vendor-Id>
                  <Built-By>io7m</Built-By>
                </manifestEntries>
              </archive>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>3.4</version>
        <executions>
          <execution>
            <id>mojo-descriptor</id>
            <phase>process-classes</phase>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
