<?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/maven-v4_0_0.xsd">

  <!-- Parent -->
  <parent>
    <groupId>org.jboss</groupId>
    <artifactId>jboss-parent</artifactId>
    <version>22</version>
    <relativePath />
  </parent>

  <!-- Model Version -->
  <modelVersion>4.0.0</modelVersion>

  <!-- Artifact Configuration -->
  <groupId>org.jboss.arquillian.extension</groupId>
  <artifactId>arquillian-extension-byteman</artifactId>
  <name>Arquillian Extension Byteman</name>
  <description>Byteman integration for the Arquillian project</description>
  <version>1.0.0</version>

  <scm>
    <connection>scm:git:git://git@github.com:arquillian/arquillian-extension-byteman.git</connection>
    <developerConnection>scm:git:ssh://github.com/arquillian/arquillian-extension-byteman.git</developerConnection>
    <url>git://github.com/arquillian/arquillian-extension-byteman.git</url>
    <tag>1.0.0</tag>
  </scm>

  <!-- Properties -->
  <properties>
    <!-- Versioning -->
    <version.arquillian_core>1.4.0.Final</version.arquillian_core>
    <version.arquillian_chameleon>1.0.0.Beta1</version.arquillian_chameleon>
    <version.javaee_spec>1.0.3.Final</version.javaee_spec>
    <version.byteman>4.0.2</version.byteman>
    <version.jarjar>1.9</version.jarjar>
    <version.xalan>2.7.2</version.xalan>
    <path.tools_jar>${java.home}/../lib/tools.jar</path.tools_jar>
    <!-- <path.tools_jar>/usr/lib/jvm/java-6-openjdk/lib/tools.jar</path.tools_jar> -->
    <arq.server.jvm.args.debug />
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.jboss.arquillian</groupId>
        <artifactId>arquillian-bom</artifactId>
        <version>${version.arquillian_core}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.jboss.arquillian</groupId>
        <artifactId>arquillian-build</artifactId>
        <version>${version.arquillian_core}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.jboss.spec</groupId>
        <artifactId>jboss-javaee-7.0</artifactId>
        <version>${version.javaee_spec}</version>
        <type>pom</type>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>xalan</groupId>
        <artifactId>xalan</artifactId>
        <version>${version.xalan}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>


  <!-- Dependencies -->
  <dependencies>

    <!-- org.jboss.arquillian -->
    <dependency>
      <groupId>org.jboss.arquillian.core</groupId>
      <artifactId>arquillian-core-spi</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.arquillian.container</groupId>
      <artifactId>arquillian-container-spi</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.arquillian.container</groupId>
      <artifactId>arquillian-container-test-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.arquillian.container</groupId>
      <artifactId>arquillian-container-test-spi</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jboss.shrinkwrap</groupId>
      <artifactId>shrinkwrap-impl-base</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.shrinkwrap</groupId>
      <artifactId>shrinkwrap-spi</artifactId>
    </dependency>

    <dependency>
      <groupId>com.sun</groupId>
      <artifactId>tools</artifactId>
      <version>1.6.0</version>
      <scope>system</scope>
      <systemPath>${path.tools_jar}</systemPath>
    </dependency>

    <!-- org.joss.byteman -->

    <dependency>
      <groupId>org.jboss.byteman</groupId>
      <artifactId>byteman</artifactId>
      <version>${version.byteman}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.byteman</groupId>
      <artifactId>byteman-submit</artifactId>
      <version>${version.byteman}</version>
      <scope>provided</scope>
    </dependency>

    <!-- Test -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.jboss.arquillian.junit</groupId>
      <artifactId>arquillian-junit-container</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.arquillian.container</groupId>
      <artifactId>arquillian-container-chameleon</artifactId>
      <version>${version.arquillian_chameleon}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.jboss.spec</groupId>
      <artifactId>jboss-javaee-7.0</artifactId>
      <type>pom</type>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <testResources>
        <testResource>
            <directory>src/test/resources</directory>
            <filtering>true</filtering>
        </testResource>
    </testResources>
  
    <plugins>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <pushChanges>false</pushChanges>
          <localCheckout>true</localCheckout>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemProperties>
            <path.tools_jar>${path.tools_jar}</path.tools_jar>
            <arq.server.jvm.args.debug>${arq.server.jvm.args.debug}</arq.server.jvm.args.debug>
          </systemProperties>
          <runOrder>alphabetical</runOrder>
          <excludes>
            <exclude>%regex[.*local.*]</exclude>
          </excludes>
        </configuration>
      </plugin>
      <!-- We need to jarjar this, since WildFly grabs all org.jboss.byteman
          as system packages -->
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>jarjar-maven-plugin</artifactId>
        <version>${version.jarjar}</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>jarjar</goal>
            </goals>
            <configuration>
              <includes>
                <include>org.jboss.byteman:byteman-submit</include>
              </includes>
              <rules>
                <rule>
                  <pattern>org.jboss.byteman.agent.submit.**</pattern>
                  <result>org.jboss.arquillian.extension.byteman.agent.submit.@1</result>
                </rule>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
        <profile>
          <id>debug</id>
          <activation>
            <property>
              <name>debug</name>
            </property>
          </activation>
          <properties>
            <arq.server.jvm.args.debug>-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y</arq.server.jvm.args.debug>
          </properties>
        </profile>
      <profile>
      </profile>
  </profiles>
</project>

