<!--
  ~ JBoss, Home of Professional Open Source.
  ~ Copyright 2010, Red Hat, Inc., and individual contributors
  ~ as indicated by the @author tags. See the copyright.txt file in the
  ~ distribution for a full listing of individual contributors.
  ~
  ~ This is free software; you can redistribute it and/or modify it
  ~ under the terms of the GNU Lesser General Public License as
  ~ published by the Free Software Foundation; either version 2.1 of
  ~ the License, or (at your option) any later version.
  ~
  ~ This software is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  ~ Lesser General Public License for more details.
  ~
  ~ You should have received a copy of the GNU Lesser General Public
  ~ License along with this software; if not, write to the Free
  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  -->

<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>org.jboss</groupId>
        <artifactId>jboss-parent</artifactId>
        <version>10</version>
    </parent>

    <groupId>org.jboss.msc</groupId>
    <artifactId>jboss-msc</artifactId>
    <version>1.2.6.Final</version>
    <name>JBoss Modular Service Container</name>

    <properties>
        <version.apiviz>1.3.2.GA</version.apiviz>
        <version.byteman>3.0.0</version.byteman>
        <version.jboss-logmanager>1.4.1.Final</version.jboss-logmanager>
        <version.jboss-logging>3.1.3.GA</version.jboss-logging>
        <version.jboss-logging-processor>1.1.0.Final</version.jboss-logging-processor>
        <version.jboss-modules>1.2.2.Final</version.jboss-modules>
        <version.junit>4.8.2</version.junit>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging-processor</artifactId>
            <version>${version.jboss-logging-processor}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.modules</groupId>
            <artifactId>jboss-modules</artifactId>
            <version>${version.jboss-modules}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
            <version>${version.jboss-logging}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.logmanager</groupId>
            <artifactId>jboss-logmanager</artifactId>
            <version>${version.jboss-logmanager}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${version.junit}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.byteman</groupId>
            <artifactId>byteman</artifactId>
            <version>${version.byteman}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.byteman</groupId>
            <artifactId>byteman-bmunit</artifactId>
            <version>${version.byteman}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.byteman</groupId>
            <artifactId>byteman-install</artifactId>
            <version>${version.byteman}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <compilerArgument>-AloggingVersion=3.0</compilerArgument>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <!--  uncomment this to enable byteman rule debug messages
                    <argLine>-Dorg.jboss.byteman.debug</argLine> -->
                    <includes>
                        <include>**/*TestCase.java</include>
                    </includes>
                    <excludes>
                        <exclude>org/jboss/msc/bench/*.java</exclude>
                    </excludes>
                    <systemProperties>
                        <property>
                            <name>test.log.output</name>
                            <value>${project.build.directory}/surefire-reports</value>
                        </property>
                        <property>
                            <name>jboss.msc.profile.output</name>
                            <value>${project.build.testOutputDirectory}/prof.txt</value>
                        </property>
                        <property>
                            <name>java.util.logging.manager</name>
                            <value>org.jboss.logmanager.LogManager</value>
                        </property>
                        <property>
                            <name>racecondition.dir</name>
                            <value>${project.build.testOutputDirectory}</value>
                        </property>
                        <property>
                            <name>org.jboss.byteman.transform.all</name>
                            <value>true</value>
                        </property>
                    </systemProperties>
                </configuration>
                <executions>
                    <execution>
                        <id>rejected-execution-test</id>
                        <goals><goal>test</goal></goals>
                        <configuration>
                            <systemProperties>
                                <property>
                                    <name>org.jboss.byteman.transform.all</name>
                                    <value>true</value>
                                </property>
                                <property>
                                    <name>test.log.output</name>
                                    <value>${project.build.directory}/surefire-reports</value>
                                </property>
                                <property>
                                    <name>java.util.logging.manager</name>
                                    <value>org.jboss.logmanager.LogManager</value>
                                </property>
                            </systemProperties>
                            <!-- add this to agent parameter list to enable debug ,prop:org.jboss.byteman.debug=true -->
                            <argLine>-Xbootclasspath/a:${settings.localRepository}/org/jboss/logmanager/${version.jboss-logmanager}/jboss-logmanager-${version.jboss-logmanager}.jar
                                -javaagent:${settings.localRepository}/org/jboss/byteman/byteman/${version.byteman}/byteman-${version.byteman}.jar=boot:${settings.localRepository}/org/jboss/byteman/byteman/${version.byteman}/byteman-${version.byteman}.jar,script:${project.build.testOutputDirectory}/org/jboss/msc/racecondition/RejectedExecutionTestCase.btm</argLine>
                            <includes>
                                <include>org/jboss/msc/racecondition/RejectedExecutionTestSuite.java</include>
                            </includes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>removal-during-cycle-detection-test</id>
                        <goals><goal>test</goal></goals>
                        <configuration>
                            <systemProperties>
                                <property>
                                    <name>test.log.output</name>
                                    <value>${project.build.directory}/surefire-reports</value>
                                </property>
                                <property>
                                    <name>java.util.logging.manager</name>
                                    <value>org.jboss.logmanager.LogManager</value>
                                </property>
                            </systemProperties>
                            <includes>
                                <include>org/jboss/msc/racecondition/RemovalDuringCycleDetectionTest.java</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <docfilessubdirs>true</docfilessubdirs>
                    <detectJavaApiLink>false</detectJavaApiLink>
                    <detectLinks>false</detectLinks>
                    <doclet>net.gleamynode.apiviz.APIviz</doclet>
                    <docletArtifact>
                        <groupId>org.jboss.apiviz</groupId>
                        <artifactId>apiviz</artifactId>
                        <version>${version.apiviz}</version>
                    </docletArtifact>
                    <doctitle><![CDATA[JBoss Modular Service Container ]]>${project.version}</doctitle>
                    <header><![CDATA[JBoss Modular Service Container ]]>${project.version}</header>
                    <footer><![CDATA[JBoss Modular Service Container  ]]>${project.version}</footer>
                    <bottom><![CDATA[<i>Copyright &#169; 2012 JBoss, a division of Red Hat, Inc.</i>]]></bottom>
                    <links>
                        <link>http://java.sun.com/javase/6/docs/api/</link>
                    </links>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Jar-Version>${project.version}</Jar-Version>
                            <Jar-Name>${project.artifactId}</Jar-Name>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
