<?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>org.daisy</groupId>
    <artifactId>daisy</artifactId>
    <version>2</version>
    <relativePath />
  </parent>

  <groupId>org.daisy.libs</groupId>
  <artifactId>jing</artifactId>
  <version>20120724.0.0</version>
  <packaging>jar</packaging>

  <name>Jing</name>
  <description>Jing - tool for validating RelaxNG - (OSGi-compatible version)</description>
  <url>http://code.google.com/p/jing-trang</url>
  <organization>
    <name>Thai Open Source Software Center Ltd</name>
    <url>http://www.thaiopensource.com/relaxng/jing.html</url>
  </organization>
  <licenses>
    <license>
      <name>New BSD License</name>
      <url>http://www.opensource.org/licenses/bsd-license.php</url>
    </license>
  </licenses>
  <scm>
    <connection>scm:svn:http://jing-trang.googlecode.com/svn/trunk/</connection>
    <url>http://code.google.com/p/jing-trang/source/browse/</url>
    <tag>jing-20120724.0.0</tag>
  </scm>
  <developers>
    <developer>
      <id>jclark</id>
      <name>James Clark</name>
      <email>jjc@jclark.com</email>
      <roles>
        <role>developer</role>
      </roles>
    </developer>
  </developers>
  
  <dependencies>
      <dependency>
        <groupId>isorelax</groupId>
        <artifactId>isorelax</artifactId>
        <version>20030108</version>
        <optional>true</optional>
      </dependency>
      <dependency>
        <groupId>net.sf.saxon</groupId>
        <artifactId>saxon</artifactId>
        <version>8.7</version>
        <optional>true</optional>
      </dependency>
      <dependency>
        <groupId>org.apache.ant</groupId>
        <artifactId>ant</artifactId>
        <version>1.7.1</version>
        <optional>true</optional>
      </dependency>
      <dependency>
        <groupId>saxon</groupId>
        <artifactId>saxon</artifactId>
        <version>6.5.3</version>
        <optional>true</optional>
      </dependency>
      <dependency>
        <groupId>xalan</groupId>
        <artifactId>xalan</artifactId>
        <version>2.7.1</version>
        <optional>true</optional>
      </dependency>
      <dependency>
        <groupId>xerces</groupId>
        <artifactId>xercesImpl</artifactId>
        <version>2.10.0</version>
        <optional>true</optional>
      </dependency>
      <dependency>
        <groupId>xml-apis</groupId>
        <artifactId>xml-apis</artifactId>
        <version>1.4.01</version>
      </dependency>
      <dependency>
        <groupId>xml-resolver</groupId>
        <artifactId>xml-resolver</artifactId>
        <version>1.2</version>
        <optional>true</optional>
      </dependency>
    </dependencies>
    
  <build>
    <plugins>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
            <excludes>
              <exclude>**</exclude>
            </excludes>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-scm-plugin</artifactId>
          <version>1.7</version>
          <executions>
            <execution>
              <id>checkout</id>
              <phase>generate-sources</phase>
              <goals>
                <goal>checkout</goal>
              </goals>
              <configuration>
                <scmVersion>2360</scmVersion>
                <scmVersionType>revision</scmVersionType>
                <skipCheckoutIfExists>true</skipCheckoutIfExists>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>1.2.1</version>
          <executions>
            <execution>
              <id>ant-compile</id>
              <phase>compile</phase>  
              <goals>
                <goal>exec</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <executable>${project.build.directory}/checkout/ant</executable>
            <workingDirectory>${project.build.directory}/checkout</workingDirectory>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-antrun-plugin</artifactId>
          <executions>
            <execution>
              <id>unjar</id>
              <phase>compile</phase>
              <goals>
                <goal>run</goal>
              </goals>
              <configuration>
                <target>
                    <unzip src="${project.build.directory}/checkout/build/jing.jar" dest="${project.build.directory}/classes" /> 
                </target>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <extensions>true</extensions>
          <executions>
            <execution>
              <id>bundle-manifest</id>
              <phase>process-classes</phase>
              <goals>
                <goal>manifest</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <instructions>
                <Bundle-SymbolicName>com.thaiopensource.jing</Bundle-SymbolicName>
                <Export-Package>org.relaxng.datatype,
                                org.relaxng.datatype.helpers,
                                com.thaiopensource.*
                </Export-Package>
                <Import-Package><!-- com.icl.saxon;resolution:=optional,
                                                net.sf.saxon;resolution:=optional,
                                                org.apache.tools.ant.*;resolution:=optional,
                                                org.apache.xalan.*;resolution:=optional,
                                                org.apache.xerces.*;resolution:=optional,
                                                org.apache.xml.resolver.*;resolution:=optional,
                                                org.apache.tools.ant.*;resolution:=optional,
                                                org.iso_relax.*;resolution:=optional, -->
                                *                                        
                </Import-Package>
                <_removeheaders>Built-By,Bnd-LastModified,Embed-Dependency,Private-Package</_removeheaders>
            </instructions>
          </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-jar-plugin</artifactId>
            <configuration>
                <archive>
                    <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                </archive>
            </configuration>
        </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>sonatype-oss-release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.2.1</version>
            <executions>
              <execution>
                <id>ant-dist</id>
                <phase>compile</phase>  
                <goals>
                  <goal>exec</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <executable>${project.build.directory}/checkout/ant</executable>
              <commandlineArgs>jing-dist</commandlineArgs>
              <workingDirectory>${project.build.directory}/checkout</workingDirectory>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>copy-src-javadoc</id>
                <phase>compile</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <target>
                      <unzip src="${project.build.directory}/checkout/build/mod/jing/src.zip" dest="${project.build.directory}/sources" /> 
                      <copy todir="${project.build.directory}/javadoc">
                          <fileset dir="${project.build.directory}/checkout/build/api/jing" />
                      </copy>
                  </target>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources-and-javadoc</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <descriptors>
                    <descriptor>sources.xml</descriptor>
                    <descriptor>javadoc.xml</descriptor>
                  </descriptors>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>