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

  <groupId>de.unkrig</groupId>
  <artifactId>doclet-main</artifactId>
  <version>1.0.0</version>

  <properties>
    <maven.compiler.source>1.6</maven.compiler.source>
    <maven.compiler.target>1.6</maven.compiler.target>
  </properties>

  <dependencies>
    <dependency>
      <groupId>de.unkrig</groupId>
      <artifactId>de-unkrig-commons</artifactId>
      <version>1.1.12</version>
    </dependency>
    <dependency>
      <groupId>com.sun</groupId>
      <artifactId>tools</artifactId>
      <version>1.6.0</version>
      <scope>system</scope>
<!--       <systemPath>${jdk.6.home}/lib/tools.jar</systemPath> -->
      <systemPath>${java.home}/../lib/tools.jar</systemPath>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
    <dependency>
    	<groupId>de.unkrig</groupId>
    	<artifactId>html2txt</artifactId>
    	<version>1.0.0</version>
    	<scope>runtime</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>

      <!-- Create "jar-with-dependencies". -->
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
        </configuration>
        <executions>
          <execution>
            <id>make-assembly</id> <!-- this is used for inheritance merges -->
            <phase>package</phase> <!-- bind to the packaging phase -->
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Create "source-jar". -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.7</version>
        <extensions>true</extensions>
        <configuration>
           <serverId>ossrh</serverId>
           <nexusUrl>https://oss.sonatype.org/</nexusUrl>
           <autoReleaseAfterClose>false</autoReleaseAfterClose>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>1.5</version>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </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>

            <configuration>
              <additionalparam>-Xdoclint:none</additionalparam>
            </configuration>
          </execution>

          <execution>
            <id>make-maindoc</id>
            <phase>compile</phase>
            <goals>
              <goal>javadoc</goal>
            </goals>

            <configuration>
              <useStandardDocletOptions>false</useStandardDocletOptions>

              <!-- The MAIN doclet requires JAVADOC 8. -->
              <javadocExecutable>${jdk.8.home}/bin/javadoc.exe</javadocExecutable>

              <quiet>true</quiet>
              <encoding>UTF-8</encoding>

              <doclet>de.unkrig.doclet.main.MainDoclet</doclet>
              <docletPath>../classes</docletPath>
              <docletArtifact>
                <groupId>de.unkrig</groupId>
                <artifactId>doclet-main</artifactId>
                <version>1.0.0</version>
              </docletArtifact>

              <additionalparam>
                -charset UTF-8
                -docencoding UTF-8
                -method start(RootDoc)
              </additionalparam>

              <destDir>../../classes</destDir>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.5.0</version>
        <executions>
          <execution>
            <id>html2txt-maindoc</id>
            <phase>compile</phase>
            <goals>
              <goal>java</goal>
            </goals>
          </execution>
        </executions>

        <configuration>
          <mainClass>de.unkrig.html2txt.Main</mainClass>
          <arguments>
            <argument>target/classes/de/unkrig/doclet/main/MainDoclet.start(RootDoc).html</argument>
            <argument>target/classes/de/unkrig/doclet/main/MainDoclet.start(RootDoc).txt</argument>
          </arguments>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <name>The MAIN doclet</name>

  <description>
    Generates a (very simple) HTML page for the "main(String[])" method (or a different method) of each of the
    specified classes. This is useful for command line tools with a set of command line options.
  </description>
  <organization>
    <name>Arno Unkrig</name>
  	<url>http://unkrig.de/w/MAIN_doclet</url>
  </organization>

  <scm>
  	<url>https://svn.code.sf.net/p/loggifier/code/trunk/de.unkrig.doclet.main</url>
  </scm>

  <licenses>
    <license>
      <name>New BSD License</name>
      <url>http://unkrig.de/w/MAIN_doclet#License</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>aunkrig</id>
      <name>Arno Unkrig</name>
      <roles>
        <role>Developer</role>
        <role>Release Manager</role>
      </roles>
    </developer>
  </developers>
  <url>http://unkrig.de/w/MAIN_doclet</url>
</project>
