<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.yamcs</groupId>
    <artifactId>yamcs</artifactId>
    <version>0.29.3</version>
    <relativePath>..</relativePath>
  </parent>

  <artifactId>yamcs-core</artifactId>
  <packaging>jar</packaging>
  <name>Yamcs Core</name>
  <inceptionYear>2002</inceptionYear>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>yamcs-api</artifactId>
      <version>${project.version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.hornetq</groupId>
          <artifactId>hornetq-core-client</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>yamcs-xtce</artifactId>
      <version>${project.version}</version>
    </dependency>


    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.python</groupId>
      <artifactId>jython-standalone</artifactId>
      <version>2.5.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
    </dependency>
    <dependency>
      <groupId>org.codehaus.janino</groupId>
      <artifactId>janino</artifactId>
      <version>2.5.15</version>
    </dependency>
    <dependency>
      <groupId>org.yaml</groupId>
      <artifactId>snakeyaml</artifactId>
      <version>1.9</version>
    </dependency>

    <dependency>
      <groupId>net.sourceforge.jdatepicker</groupId>
      <artifactId>jdatepicker</artifactId>
      <version>1.3.2</version>
    </dependency>

    <dependency>
      <groupId>net.sourceforge.jexcelapi</groupId>
      <artifactId>jxl</artifactId>
      <version>2.6.10</version>
    </dependency>
    <dependency>
      <groupId>org.hornetq</groupId>
      <artifactId>hornetq-server</artifactId>
      <version>${hornetQVersion}</version>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>18.0</version>
    </dependency>

    <dependency>
      <groupId>org.rocksdb</groupId>
      <artifactId>rocksdbjni</artifactId>
      <version>4.1.0</version>
    </dependency>
  </dependencies>

  <build>
    <testResources>
      <testResource>
        <directory>${basedir}/src/test/resources</directory>
      </testResource>
      <testResource>
         <directory>${basedir}/etc</directory>
      </testResource>
    </testResources>
    <finalName>${project.artifactId}-${project.version}</finalName>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-version</id>
            <phase>process-sources</phase>
            <configuration>
              <tasks>
                <filter token="version" value="${project.version}" />
                <copy file="misc/YamcsVersion.java" tofile="target/generated-sources/version/org/yamcs/YamcsVersion.java" filtering="true" />
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <forkCount>1</forkCount>
          <reuseForks>false</reuseForks>
           <systemProperties>
    		  <property>
     		   <name>java.util.logging.config.file</name>
   		     <value>${project.build.directory}/test-classes/logging.properties</value>
   		   </property>
            </systemProperties>
          <excludes>
             <exclude>**/PermissionsTest.java</exclude>
             <exclude>**/*$*</exclude> <!-- this excludes the inner classes which causes maven to get stuck somehow -->
          </excludes> 
        </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>
              <outputDirectory>${basedir}/lib</outputDirectory>
              <overWriteIfNewer>true</overWriteIfNewer>
              <includeScope>runtime</includeScope>
              <!-- <excludeGroupIds>com.spaceapplications.yamcs</excludeGroupIds> -->
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.4.1</version>
        <configuration>
          <filesets>
            <fileset>
              <directory>lib</directory>
              <includes>
                <include>**/*.jar</include>
              </includes>
              <followSymlinks>false</followSymlinks>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>target/generated-sources/version/</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.7</version>
        <configuration>
          <author>true</author>
          <version>true</version>
          <show>private</show>
        </configuration>
      </plugin>
    </plugins>
  </reporting>


    <!-- If we are running in Jenkins use cobertura. -->
    <profiles>
        <profile>
            <id>jenkins</id>
            <activation>
                <property>
                    <name>env.BUILD_NUMBER</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>cobertura-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
