<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>
  <prerequisites>
    <maven>3.0</maven>
  </prerequisites>

  <groupId>de.informaticum</groupId>
  <artifactId>syntaxhighlighter</artifactId>
  <version>3.0.83</version>
 
  <name>SyntaxHighlighter v3.0.83</name>
  <description>Mavenising the SyntaxHighlighter Project (by Alex Gorbatchev)</description>
  <url>https://github.com/informaticum/syntaxhighlighter-build</url>

  <licenses>
    <license>
      <name>LGPLv3</name>
      <comments>The LGPLv3 license can be found within the SyntaxHighlighter archive (${syntaxhighlighter.release.url}) and is provided in this project's root folder too.</comments>
    </license>
    <license>
      <name>MIT</name>
      <comments>The MIT license can be found within the SyntaxHighlighter archive (${syntaxhighlighter.release.url}) and is provided in this project's root folder too.</comments>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>SGA</id>
      <name>Stefan Gasterstädt</name>
      <email>stefan@gasterstädt.de</email>
      <url>http://stefan.gasterstädt.de</url>
    </developer>
  </developers>

  <properties>
    <syntaxhighlighter.release.version>3.0.83</syntaxhighlighter.release.version>
    <syntaxhighlighter.release.tag>${syntaxhighlighter.release.version}</syntaxhighlighter.release.tag>
    <syntaxhighlighter.release.url>http://alexgorbatchev.com/SyntaxHighlighter/download/download.php?sh_current</syntaxhighlighter.release.url>
    <!-- Alex Gorbatchev's download URL is broken; Thus, use the following alternative (mentioned by https://www.mediawiki.org/wiki/Extension:SyntaxHighlighter): -->
    <syntaxhighlighter.alternative.url>https://github.com/seongjaelee/SyntaxHighlighter/zipball/master</syntaxhighlighter.alternative.url>
    <syntaxhighlighter.release.file>syntaxhighlighter-${syntaxhighlighter.release.version}-release.zip</syntaxhighlighter.release.file>
  </properties>

  <scm>
    <connection>scm:git:git@github.com:informaticum/syntaxhighlighter.git</connection>
    <developerConnection>scm:git:git@github.com:informaticum/syntaxhighlighter.git</developerConnection>
    <url>https://github.com/informaticum/syntaxhighlighter-build.git</url>
    <tag>HEAD</tag>
  </scm>

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

  <profiles>
    <profile>
      <id>gpg-signing</id>
      <activation>
        <property>
          <name>gpg.keyname</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>process-resources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <get src="${syntaxhighlighter.alternative.url}" dest="${project.build.directory}/${syntaxhighlighter.release.file}"/>
                <unzip src="${project.build.directory}/${syntaxhighlighter.release.file}" dest="${project.build.directory}/unzip">
                  <cutdirsmapper dirs="1"/>
                </unzip>
                <copy todir="${project.build.outputDirectory}/syntaxhighlighter/${syntaxhighlighter.release.version}">
                  <fileset dir="${project.build.directory}/unzip/syntaxhighlighter" includes="styles/ scripts/"/>
                  <fileset dir="${project.build.directory}/unzip/syntaxhighlighter/" includes="LGPL-LICENSE MIT-LICENSE"/>
                </copy>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <!-- MAVEN LIFECYCLE: default -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>1.8</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>
        <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>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.5.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.0.2</version>
          <configuration>
            <forceCreation>true</forceCreation>
            <archive>
              <manifest>
                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              </manifest>
            </archive>
          </configuration>
        </plugin>
        <!-- MAVEN LIFECYCLE: clean -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.0.0</version>
          <configuration>
            <failOnError>true</failOnError>
          </configuration>
        </plugin>
        <!-- MAVEN LIFECYCLE: site -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.5.1</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

</project>
