<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.legsem.legstar</groupId>
    <artifactId>legstar-core2</artifactId>
    <version>2.0.2</version>
  </parent>

  <artifactId>legstar-cob2xsd</artifactId>
  <packaging>jar</packaging>

  <name>legstar-cob2xsd</name>

  <dependencies>

      <!-- ANTLR -->
      <dependency>
          <groupId>org.antlr</groupId>
          <artifactId>antlr</artifactId>
      </dependency>
      <dependency>
          <groupId>org.antlr</groupId>
          <artifactId>antlr-runtime</artifactId>
      </dependency>

       <!-- XML schema -->
      <dependency>
          <groupId>org.apache.ws.xmlschema</groupId>
          <artifactId>xmlschema-core</artifactId>
      </dependency>

      <!-- Apache utils -->
      <dependency>
          <groupId>commons-io</groupId>
          <artifactId>commons-io</artifactId>
      </dependency>
      <dependency>
          <groupId>commons-cli</groupId>
          <artifactId>commons-cli</artifactId>
      </dependency>
      <dependency>
          <groupId>org.apache.commons</groupId>
          <artifactId>commons-lang3</artifactId>
      </dependency>

      <!-- Logging -->
      <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
      </dependency>
      <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-log4j12</artifactId>
      </dependency>

      <!-- Tests -->
      <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <scope>test</scope>
      </dependency>

      <!-- Used to graph ASTs -->
      <dependency>
          <groupId>org.antlr</groupId>
          <artifactId>stringtemplate</artifactId>
          <scope>test</scope>
      </dependency>

      <!-- XML testing -->
      <dependency>
          <groupId>xmlunit</groupId>
          <artifactId>xmlunit</artifactId>
          <scope>test</scope>
      </dependency>

  </dependencies>

  <build>

      <!-- Used for version -->
      <resources>
          <resource>
              <directory>src/main/resources</directory>
              <filtering>true</filtering>
          </resource>
      </resources>

      <plugins>

          <plugin>
              <groupId>org.antlr</groupId>
              <artifactId>antlr3-maven-plugin</artifactId>
              <configuration>
                  <verbose>true</verbose>
                  <report>false</report>
                  <dfa>false</dfa>
                  <libDirectory>${project.build.directory}/generated-sources/antlr3/com/legstar/cob2xsd</libDirectory>
              </configuration>
              <executions>
                  <execution>
                      <id>parser</id>
                      <phase>generate-sources</phase>
                      <goals>
                          <goal>antlr</goal>
                      </goals>
                  </execution>
              </executions>
          </plugin>

          <!-- Add generated java classes common folder as source folder -->
          <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>build-helper-maven-plugin</artifactId>
              <executions>
                  <execution>
                      <phase>generate-sources</phase>
                      <goals>
                          <goal>add-source</goal>
                      </goals>
                      <configuration>
                          <sources>
                              <source>${project.build.directory}/generated-sources/antlr3</source>
                          </sources>
                      </configuration>
                  </execution>
              </executions>
          </plugin>

          <!-- Make the jar executable (referencing a lib folder for dependencies) -->
          <plugin>
              <artifactId>maven-jar-plugin</artifactId>
              <configuration>
                  <archive>
                      <manifest>
                          <addClasspath>true</addClasspath>
                          <classpathPrefix>lib/</classpathPrefix>
                          <mainClass>com.legstar.cob2xsd.Cob2XsdMain</mainClass>
                      </manifest>
                  </archive>
              </configuration>
          </plugin>

          <plugin>
              <artifactId>maven-assembly-plugin</artifactId>
              <executions>
                  <execution>
                      <id>make-assembly</id>
                      <phase>package</phase>
                      <goals>
                          <goal>single</goal>
                      </goals>
                      <configuration>
                          <appendAssemblyId>false</appendAssemblyId>
                          <descriptors>
                              <descriptor>assembly.xml</descriptor>
                          </descriptors>
                          <archiverConfig>
                              <duplicateBehavior>skip</duplicateBehavior>
                              <fileMode>0644</fileMode>
                              <directoryMode>0755</directoryMode>
                              <defaultDirectoryMode>0755</defaultDirectoryMode>
                          </archiverConfig>
                      </configuration>
                  </execution>
               </executions>
          </plugin>


       </plugins>
  </build>

  <reporting>

      <plugins>

          <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>findbugs-maven-plugin</artifactId>
              <version>2.5.5</version>
          </plugin>

      </plugins>

  </reporting>

</project>
