<?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>net.deelam</groupId>
    <artifactId>graphtools-top-pom</artifactId>
    <version>0.0.3</version>
  </parent>
  <artifactId>graphtools-dev-pom</artifactId>
  <packaging>pom</packaging>
  <name>${project.groupId}:${project.artifactId}</name>
  <properties>
    <bundle.embedDependency />
    <bundle.import_package>
<!--sun.misc;resolution:=optional, sun.reflect;resolution:=optional,-->
    *</bundle.import_package>
  </properties>
  <modules>
    <module>core</module>
    <module>importer</module>
    <module>hadoop</module>
    <module>enricher</module>
  </modules>
  <profiles>
    <profile>
      <id>skipTests-exists</id>
      <activation>
        <file>
          <exists>skipTests</exists>
        </file>
      </activation>
      <properties>
        <maven.test.skip>true</maven.test.skip>
      </properties>
    </profile>
    <profile>
      <id>ifFindBugExclude-exists</id>
      <activation>
        <file>
          <exists>findbugs-exclude.xml</exists>
        </file>
      </activation>
      <properties>
        <findbugs-exclude>findbugs-exclude.xml</findbugs-exclude>
      </properties>
    </profile>
    <profile>
      <id>devSubdir-only</id>
      <activation>
        <file>
          <missing>../dev</missing>
        </file>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-log4j12</artifactId>
        </dependency>
        <dependency>
          <groupId>org.projectlombok</groupId>
          <artifactId>lombok</artifactId>
        </dependency>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>commons-io</groupId>
          <artifactId>commons-io</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-clean-plugin</artifactId>
            <version>2.4.1</version>
            <configuration>
              <followSymLinks>false</followSymLinks>
              <filesets>
                <fileset>
                  <directory>${basedir}/META-INF</directory>
                </fileset>
                <fileset>
                  <directory>${basedir}/OSGI-INF</directory>
                </fileset>
                <fileset>
                  <directory>${basedir}/lib</directory>
                </fileset>
              </filesets>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>1.9.1</version>
            <executions>
              <execution>
                <id>set-buildnumber</id>
                <goals>
                  <goal>timestamp-property</goal>
                </goals>
                <configuration>
                  <name>currenttime</name>
                  <pattern>yyyy-MM-dd-HH:mm:ss</pattern>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>2.5.3</version> <!-- Do not use 2.5.4: http://stackoverflow.com/questions/31231453/when-using-bundle-packaging-with-maven-bundle-plugin-goals-are-executed-twice -->
            <extensions>true</extensions>
            <configuration>
              <obrRepository>NONE</obrRepository>
              <niceManifest>true</niceManifest>
              <manifestLocation>META-INF</manifestLocation>
              <instructions>
                <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                <Import-Package>${bundle.import_package}</Import-Package>
                <!-- still need to embed since some packages are not listed in bundle.exportPackage property -->
                <Embed-Dependency>${bundle.embedDependency}</Embed-Dependency>
                <Embed-Transitive>true</Embed-Transitive>
                <Embed-Directory>lib</Embed-Directory>
                <Embed-StripGroup>true</Embed-StripGroup>
                <BuildNumber>${currenttime}</BuildNumber>
              </instructions>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>copy-dependencies</id>
                <phase>package</phase>
                <goals>
                  <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                  <silent>true</silent>
                  <!-- hadoop expects a 'lib' subdir, so the MANIFEST.MF's Bundle-Classpath should point to 'lib', so if running as OSGI bundle as an Eclipse project, Eclipse needs to find 'lib', which is why we have to copy the jar to lib -->
                  <outputDirectory>lib</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
<!--
          <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-scr-plugin</artifactId>
            <version>1.21.0</version>
            <executions>
              <execution>
                <id>generate-scr-scrdescriptor</id>
                <goals>
                  <goal>scr</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
-->
          <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.6</version>
            <executions>
              <execution>
                <id>copy-osgi-inf-for-eclipse</id>
                <phase>package</phase>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <configuration>
                  <outputDirectory>${basedir}/OSGI-INF</outputDirectory>
                  <resources>
                    <resource>
                      <directory>${project.build.directory}/classes/OSGI-INF</directory>
                    </resource>
                  </resources>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
            <version>2.5.2</version>
            <configuration>
              <format>xml</format>
              <instrumentation>
                <excludes />
              </instrumentation>
            </configuration>
            <executions>
              <execution>
                <id>clean</id>
                <goals>
                  <goal>clean</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
            <version>3.0.2</version>
            <configuration>
              <findbugsXmlOutput>true</findbugsXmlOutput>
              <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
              <xmlOutput>true</xmlOutput>
              <excludeFilterFile>${findbugs-exclude}</excludeFilterFile>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-pmd-plugin</artifactId>
            <version>3.0.1</version>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jdepend-maven-plugin</artifactId>
            <version>2.0</version>
          </plugin>
        </plugins>
      </build>
      <reporting>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
            <version>3.0.2</version>
            <configuration>
              <excludeFilterFile>${findbugs-exclude}</excludeFilterFile>
            </configuration>
          </plugin>
        </plugins>
      </reporting>
    </profile>
  </profiles>
</project>
