<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>
    <groupId>org.jboss.microcontainer</groupId>
    <artifactId>jboss-microcontainer</artifactId>
    <version>2.0.0.Beta6</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>jboss-aop-mc-int</artifactId>
  <packaging>jar</packaging>
  <name>JBoss Microcontainer AOP MC INT</name>
  <url>http://www.jboss.com/products/jbossmc</url>
  <description>JBoss Microcontainer</description>
  <build>
    <resources>
      <resource>
        <directory>src/resources/main</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/resources/tests</directory>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptors>
            <descriptor>src/assembly/impl.xml</descriptor>
            <descriptor>src/assembly/aspects.xml</descriptor>
          </descriptors>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <executions>
          <execution>
            <id>weave</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <skip>true</skip>
              <includes>
                <include>org/jboss/test/**/*TestCase.java</include>
              </includes>
             <useSystemClassLoader>true</useSystemClassLoader>
              <argLine>-Djava.system.class.loader=org.jboss.aop.standalone.SystemClassLoader</argLine>
              <reportsDirectory>${project.build.directory}/surefire-reports/weave</reportsDirectory>     
              <systemProperties>
                <property>
                  <name>jboss.aop.exclude</name>
                  <value>org.jboss.,org.apache.</value>
                </property>
                <property>
                  <name>jboss.aop.include</name>
                  <value>org.jboss.test.</value>
                </property>
                <property>
                  <name>jboss-junit-configuration</name>
                  <value>weave</value>
                </property>
                <property>
                  <name>build.testlog</name>
                  <value>target/log</value>
                </property>
                <property>
                  <name>jboss.aop.verbose</name>
                  <value>true</value>
                </property>
              </systemProperties>
            </configuration>
          </execution>
          <execution>
            <id>weave-secure</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <skip>true</skip>
              <reportsDirectory>${project.build.directory}/surefire-reports/weave-secure</reportsDirectory>     
              <includes>
                <include>org/jboss/test/**/*TestCase.java</include>
              </includes>
              <useSystemClassLoader>true</useSystemClassLoader>
              <argLine>-Djava.system.class.loader=org.jboss.aop.standalone.SystemClassLoader</argLine>
              <systemProperties>
                <property>
                  <name>jboss.aop.exclude</name>
                  <value>org.jboss.,org.apache.</value>
                </property>
                <property>
                  <name>jboss.aop.include</name>
                  <value>org.jboss.test.</value>
                </property>
                <property>
                  <name>jboss-junit-configuration</name>
                  <value>weave</value>
                </property>
                <property>
                  <name>build.testlog</name>
                  <value>target/log</value>
                </property>
                <property>
                  <name>jboss.mc.secure</name>
                  <value>true</value>
                </property>
              </systemProperties>
            </configuration>
          </execution>
          <execution>
            <id>no-weave</id>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <skip>true</skip>
              <reportsDirectory>${project.build.directory}/surefire-reports/no-weave</reportsDirectory>     
              <includes>
                <include>org/jboss/test/microcontainer/test/**/*TestCase.java</include>
              </includes>
              <systemProperties>
                <property>
                  <name>jboss-junit-configuration</name>
                  <value>no_weave</value>
                </property>
                <property>
                  <name>build.testlog</name>
                  <value>target/log</value>
                </property>
              </systemProperties>
            </configuration>
          </execution>
          <execution>
            <id>no-weave-secure</id>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <skip>true</skip>
              <reportsDirectory>${project.build.directory}/surefire-reports/no-weave-secure</reportsDirectory>     
              <includes>
                <include>org/jboss/test/microcontainer/test/**/*TestCase.java</include>
              </includes>
              <systemProperties>
                <property>
                  <name>jboss-junit-configuration</name>
                  <value>no_weave</value>
                </property>
                <property>
                  <name>build.testlog</name>
                  <value>target/log</value>
                </property>
                <property>
                  <name>jboss.mc.secure</name>
                  <value>true</value>
                </property>
              </systemProperties>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <testFailureIgnore>true</testFailureIgnore>
          <forkMode>always</forkMode>
          <redirectTestOutputToFile>true</redirectTestOutputToFile>          
          <skip>true</skip>
          <trimStackTrace>false</trimStackTrace>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.jboss</groupId>
        <artifactId>jboss-test</artifactId>
        <version>${version.org.jboss.test}</version>
        <scope>compile</scope>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${version.junit}</version>
        <scope>compile</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <!-- Do not add version information here, use ../build/pom.xml instead -->
  <dependencies>
    <!-- Global dependencies -->
    <dependency>
      <groupId>org.jboss.aop</groupId>
      <artifactId>jboss-aop</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.jboss.microcontainer</groupId>
          <artifactId>jboss-container</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.jboss.microcontainer</groupId>
          <artifactId>jboss-dependency</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.jboss</groupId>
      <artifactId>jboss-common-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.microcontainer</groupId>
      <artifactId>jboss-container</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.microcontainer</groupId>
      <artifactId>jboss-dependency</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.microcontainer</groupId>
      <artifactId>jboss-kernel</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss</groupId>
      <artifactId>jbossxb</artifactId>
    </dependency>
    <dependency>
      <groupId>jboss</groupId>
      <artifactId>jboss-logging-spi</artifactId>
    </dependency>
    <!-- Test dependencies -->
    <dependency>
      <groupId>org.jboss</groupId>
      <artifactId>jboss-test</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.microcontainer</groupId>
      <artifactId>jboss-kernel</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <profiles>
    <profile>
      <id>tests-weave</id>
      <activation>
        <property>
          <name>tests-weave</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>weave</id>
                <configuration>
                  <skip>false</skip>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <configuration>
              <reportsDirectory>${project.build.directory}/surefire-reports/weave</reportsDirectory>
              <outputName>surefire-report-weave</outputName>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>tests-weave-secure</id>
      <activation>
        <property>
          <name>tests-weave-secure</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>weave-secure</id>
                <configuration>
                  <skip>false</skip>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <configuration>
              <reportsDirectory>${project.build.directory}/surefire-reports/weave-secure</reportsDirectory>
              <outputName>surefire-report-weave-secure</outputName>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>tests-no-weave</id>
      <activation>
        <property>
          <name>tests-no-weave</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>no-weave</id>
                <configuration>
                  <skip>false</skip>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <configuration>
              <reportsDirectory>${project.build.directory}/surefire-reports/no-weave</reportsDirectory>
              <outputName>surefire-report-no-weave</outputName>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>tests-no-weave-secure</id>
      <activation>
        <property>
          <name>tests-no-weave-secure</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>no-weave-secure</id>
                <configuration>
                  <skip>false</skip>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <configuration>
              <reportsDirectory>${project.build.directory}/surefire-reports/no-weave-secure</reportsDirectory>
              <outputName>surefire-report-no-weave-secure</outputName>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>ant-tests-weave</id>
      <activation>
        <property>
          <name>ant-tests-weave</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>ant-tests-weave</id>
                <phase>test</phase>
                <configuration>
                  <tasks>
                    <mkdir dir="${project.build.directory}/surefire-reports/ant-weave"/>
                    <property name="build.testlog" value="${project.build.directory}/log"/>
                    <mkdir dir="${build.testlog}"/>
                    <!-- Remove the test.log so each run has a fresh log -->
                    <delete file="${build.testlog}/test.log"/>
                    <junit dir="${project.build.directory}"
                       printsummary="yes"
                       haltonerror="false"
                       haltonfailure="false"
                       fork="true">
              
                       <sysproperty key="jboss.aop.exclude" value="org.jboss.,org.apache."/>
                       <sysproperty key="jboss.aop.include" value="org.jboss.test."/>
                       <sysproperty key="jboss-junit-configuration" value="weave"/>
                       <sysproperty key="build.testlog" value="${build.testlog}"/>
                       <sysproperty key="java.system.class.loader" value="org.jboss.aop.standalone.SystemClassLoader"/>
              
                       <classpath>
                          <path refid="maven.test.classpath"/>
                       </classpath>
              
                       <formatter type="plain" usefile="true" extension=".txt"/>
                       <formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
                                  usefile="true" extension=".xml"/>
              
                       <batchtest todir="${project.build.directory}/surefire-reports/ant-weave"
                          haltonerror="false"
                          haltonfailure="false"
                          fork="true">
              
                          <fileset dir="${project.build.directory}/tests-classes">
                             <include name="org/jboss/test/**/*TestCase.class"/>
                          </fileset>
                       </batchtest>
                    </junit>
                  </tasks>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions> 
            <dependencies>
              <dependency>
                <groupId>org.apache.ant</groupId>
                <artifactId>ant-junit</artifactId>
                <version>${version.ant.junit}</version>
              </dependency>
            </dependencies>     
          </plugin>
          <plugin>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <configuration>
              <reportsDirectory>${project.build.directory}/surefire-reports/ant-weave</reportsDirectory>
              <outputName>surefire-report-ant-weave</outputName>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>ant-tests-weave-secure</id>
      <activation>
        <property>
          <name>ant-tests-weave-secure</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>ant-tests-weave-secure</id>
                <phase>test</phase>
                <configuration>
                  <tasks>
                    <mkdir dir="${project.build.directory}/surefire-reports/ant-weave-secure"/>
                    <property name="build.testlog" value="${project.build.directory}/log"/>
                    <mkdir dir="${build.testlog}"/>
                    <!-- Remove the test.log so each run has a fresh log -->
                    <delete file="${build.testlog}/test.log"/>
                    <junit dir="${project.build.directory}"
                       printsummary="yes"
                       haltonerror="false"
                       haltonfailure="false"
                       fork="true">
              
                       <sysproperty key="jboss.aop.exclude" value="org.jboss.,org.apache."/>
                       <sysproperty key="jboss.aop.include" value="org.jboss.test."/>
                       <sysproperty key="jboss-junit-configuration" value="weave-secure"/>
                       <sysproperty key="build.testlog" value="${build.testlog}"/>
                       <sysproperty key="java.system.class.loader" value="org.jboss.aop.standalone.SystemClassLoader"/>
                       <sysproperty key="jboss.mc.secure" value="true"/>
              
                       <classpath>
                          <path refid="maven.test.classpath"/>
                       </classpath>
              
                       <formatter type="plain" usefile="true" extension=".txt"/>
                       <formatter classname="org.jboss.ant.taskdefs.XMLJUnitMultipleResultFormatter"
                                  usefile="true" extension=".xml"/>
              
                       <batchtest todir="${project.build.directory}/surefire-reports/ant-weave-secure"
                          haltonerror="false"
                          haltonfailure="false"
                          fork="true">
              
                          <fileset dir="${project.build.directory}/tests-classes">
                             <include name="org/jboss/test/**/*TestCase.class"/>
                          </fileset>
                       </batchtest>
                    </junit>
                  </tasks>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions> 
            <dependencies>
              <dependency>
                <groupId>org.apache.ant</groupId>
                <artifactId>ant-junit</artifactId>
                <version>${version.ant.junit}</version>
              </dependency>
            </dependencies>     
          </plugin>
          <plugin>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <configuration>
              <reportsDirectory>${project.build.directory}/surefire-reports/ant-weave-secure</reportsDirectory>
              <outputName>surefire-report-ant-weave-secure</outputName>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
