<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.picketbox</groupId>
        <artifactId>jbosssx-pom</artifactId>
        <version>5.1.0.Final</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>jbosssx-bare</artifactId>
    <packaging>jar</packaging>
    <name>PicketBox implementation</name>
    <url>http://jboss.org/picketbox</url>
    <description>PicketBox is a security project for Java Applications.</description>

    <build>
        <finalName>${project.artifactId}</finalName>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.dtd</include>
                    <include>**/security-config*.xsd</include>
                </includes>
            </resource>
            <resource>
                <directory>target/generated-sources/javacc</directory>
                <includes>
                    <include>**/*.class</include>
                </includes>
            </resource>
        </resources>
        <plugins>
            <!-- generate java files from grammar -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>javacc-maven-plugin</artifactId>
                <version>${version.javacc.plugin}</version>
                <configuration>
                    <packageName>org/jboss/security/auth/login</packageName>
                    <sourceDirectory>src/main/java</sourceDirectory>
                    <isStatic>false</isStatic>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>javacc</goal>
                        </goals>
                        <id>javacc</id>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <forkMode>always</forkMode>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging-annotations</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.logging</groupId>
            <artifactId>jboss-logging-processor</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.modules</groupId>
            <artifactId>jboss-modules</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.security</groupId>
            <artifactId>jbossxacml</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.resource</groupId>
            <artifactId>jboss-connector-api_1.6_spec</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.security.auth.message</groupId>
            <artifactId>jboss-jaspi-api_1.1_spec</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.security.jacc</groupId>
            <artifactId>jboss-jacc-api_1.5_spec</artifactId>
        </dependency>
        <dependency>
            <groupId>org.picketbox</groupId>
            <artifactId>acl-spi</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.picketbox</groupId>
            <artifactId>authorization-spi</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.picketbox</groupId>
            <artifactId>common-spi</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.picketbox</groupId>
            <artifactId>identity-spi</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.picketbox</groupId>
            <artifactId>picketbox-acl-impl</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.picketbox</groupId>
            <artifactId>picketbox-commons</artifactId>
        </dependency>
        <dependency>
            <groupId>org.picketbox</groupId>
            <artifactId>picketbox-identity-impl</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>sleepycat</groupId>
            <artifactId>je</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>sun-opends</groupId>
            <artifactId>OpenDS</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <!--    mvn install -Psecurity-manager    -->
        <profile>
            <id>security-manager</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <test.env>-Dtest.basedir=${basedir}/target/test-classes</test.env>
                <policy.file>${basedir}/src/tests/resources/java.policy</policy.file>
                <surefire.jvm.args>-Djava.security.manager -Djava.security.policy=${policy.file} ${test.env}
                </surefire.jvm.args>
            </properties>
        </profile>
        <!--     mvn install -Psecurity-manager-debug   -->
        <!-- Best Practice:    mvn install -Psecurity-manager-debug  2>&1 > logfile2>&1 > logfile -->
        <profile>
            <id>security-manager-debug</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <test.env>-Dtest.basedir=${basedir}/target/test-classes</test.env>
                <policy.file>${basedir}/src/tests/resources/java.policy</policy.file>
                <surefire.jvm.args>-Djava.security.manager -Djava.security.policy=${policy.file}
                    -Djava.security.debug=policy,failure,access ${test.env}
                </surefire.jvm.args>
            </properties>
        </profile>
        <profile>
            <id>one-test</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <surefire.jvm.args>-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8686
                </surefire.jvm.args>
            </properties>
        </profile>
    </profiles>

</project>
