<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>com.ctp.cdi.query</groupId>
        <artifactId>cdi-query-parent</artifactId>
        <version>1.0.0.Alpha4</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>cdi-query-impl</artifactId>
    <packaging>jar</packaging>

    <name>CDI Query Implementation</name>
    <!-- url required for JAR Manifest -->
    <url>${project.parent.url}</url>

    <prerequisites>
        <maven>3.0</maven>
    </prerequisites>

    <properties>
        <version.maven.compiler>2.3.1</version.maven.compiler>
        <version.maven.jxr>2.2</version.maven.jxr>
        <version.maven.surefire>2.8.1</version.maven.surefire>
        <version.maven.checkstyle>2.9</version.maven.checkstyle>
        <version.maven.pmd>2.7.1</version.maven.pmd>
        <version.maven.findbugs>2.4.0</version.maven.findbugs>
        <version.maven.cobertura>2.5.1</version.maven.cobertura>
        <jdk.source>1.6</jdk.source>
        <jdk.target>1.6</jdk.target>
        <project.parent.url>${project.artifactId}</project.parent.url>
    </properties>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${jdk.source}</source>
                    <target>${jdk.target}</target>
                </configuration>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-dependency-plugin</artifactId>
                                        <versionRange>[2.3,)</versionRange>
                                        <goals>
                                            <goal>copy</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencies>

        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.spec.javax.ejb</groupId>
            <artifactId>jboss-ejb-api_3.1_spec</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.0-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.ctp.cdi.query</groupId>
            <artifactId>cdi-query-api</artifactId>
        </dependency>
        
        <dependency>
            <groupId>org.javassist</groupId>
            <artifactId>javassist</artifactId>
            <scope>provided</scope>
        </dependency> 

        <dependency>
            <groupId>org.jboss.solder</groupId>
            <artifactId>solder-api</artifactId>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.solder</groupId>
            <artifactId>solder-impl</artifactId>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.solder</groupId>
            <artifactId>solder-logging</artifactId>
            <scope>runtime</scope>
        </dependency>

        <!-- Tests -->

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit-dep</artifactId>
        </dependency>

        <dependency>
            <groupId>org.jboss.arquillian.junit</groupId>
            <artifactId>arquillian-junit-container</artifactId>
        </dependency>
        
        <dependency>
            <groupId>org.jboss.arquillian.protocol</groupId>
            <artifactId>arquillian-protocol-servlet</artifactId>
        </dependency>
    
        <dependency>
            <groupId>org.jboss.shrinkwrap.resolver</groupId>
            <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <profiles>
    
        <profile>
            <id>arq-glassfish-31-embedded</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <testResources>
                    <testResource>
                        <directory>src/test/resources</directory>
                    </testResource>
                    <testResource>
                        <directory>src/test/resources-glassfish</directory>
                    </testResource>
                </testResources>
            </build>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.arquillian.container</groupId>
                    <artifactId>arquillian-glassfish-embedded-3.1</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.glassfish.main.extras</groupId>
                    <artifactId>glassfish-embedded-all</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.hsqldb</groupId>
                    <artifactId>hsqldb</artifactId>
                </dependency>
            </dependencies>
            <properties>
                <deploy.libs>false</deploy.libs>
            </properties>
        </profile>

        <profile>
            <id>arq-jbossas-7-managed</id>
            <build>
                <testResources>
                    <testResource>
                        <directory>src/test/resources</directory>
                    </testResource>
                    <testResource>
                        <directory>src/test/resources-jbossas7</directory>
                    </testResource>
                </testResources>
                <plugins>
                    <plugin>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <extensions>false</extensions>
                        <executions>
                            <execution>
                                <id>unpack</id>
                                <phase>process-test-classes</phase>
                                <goals><goal>unpack</goal></goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.jboss.as</groupId>
                                            <artifactId>jboss-as-dist</artifactId>
                                            <version>7.1.1.Final</version>
                                            <type>zip</type>
                                            <overWrite>false</overWrite>
                                            <outputDirectory>target</outputDirectory>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>org.jboss.as</groupId>
                    <artifactId>jboss-as-arquillian-container-managed</artifactId>
                    <version>7.1.1.Final</version>
                </dependency>
            </dependencies>
            <properties>
                <deploy.libs>true</deploy.libs>
            </properties>
        </profile>
        
        <profile>
            <id>arq-tomee-10-embedded</id>
            <build>
                <testResources>
                    <testResource>
                        <directory>src/test/resources</directory>
                    </testResource>
                    <testResource>
                        <directory>src/test/resources-tomee</directory>
                    </testResource>
                </testResources>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy</id>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>copy</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.apache.openejb</groupId>
                                            <artifactId>openejb-javaagent</artifactId>
                                            <version>4.0.0</version>
                                            <outputDirectory>${project.build.directory}</outputDirectory>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-surefire-plugin</artifactId>
                            <configuration>
                                <forkMode>pertest</forkMode>
                                <argLine>-javaagent:${basedir}/target/openejb-javaagent-4.0.0.jar</argLine>
                                <workingDirectory>${basedir}/target</workingDirectory>
                            </configuration>
                        </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>org.apache.openejb</groupId>
                    <artifactId>arquillian-tomee-embedded</artifactId>
                    <version>1.0.0</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.openejb</groupId>
                    <artifactId>openejb-core</artifactId>
                    <version>4.0.0</version><!--$NO-MVN-MAN-VER$-->
                </dependency>
                <dependency>
                    <groupId>org.apache.openjpa</groupId>
                    <artifactId>openjpa-all</artifactId>
                    <version>2.2.0</version><!--$NO-MVN-MAN-VER$-->
                </dependency>
                <dependency>
                    <groupId>org.apache.openwebbeans</groupId>
                    <artifactId>openwebbeans-spi</artifactId>
                    <version>${version.owb}</version><!--$NO-MVN-MAN-VER$-->
                </dependency>
                <dependency>
                    <groupId>org.apache.openwebbeans</groupId>
                    <artifactId>openwebbeans-impl</artifactId>
                    <version>${version.owb}</version><!--$NO-MVN-MAN-VER$-->
                </dependency>
                <dependency>
                    <groupId>org.apache.openwebbeans</groupId>
                    <artifactId>openwebbeans-ejb</artifactId>
                    <version>${version.owb}</version><!--$NO-MVN-MAN-VER$-->
                </dependency>
                <dependency>
                    <groupId>org.apache.openwebbeans</groupId>
                    <artifactId>openwebbeans-ee</artifactId>
                    <version>${version.owb}</version><!--$NO-MVN-MAN-VER$-->
                </dependency>
                <dependency>
                    <groupId>org.hsqldb</groupId>
                    <artifactId>hsqldb</artifactId>
                </dependency>
            </dependencies>
            <properties>
                <deploy.libs>false</deploy.libs>
                <version.owb>1.1.4</version.owb>
            </properties>
        </profile>
    
        <profile>
            <id>code-analysis</id>
            <build>
                <plugins>
                     <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>cobertura-maven-plugin</artifactId>
                        <version>${version.maven.cobertura}</version>
                        <configuration>
                            <formats>
                                <format>xml</format>
                            </formats>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>cobertura</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-site-plugin</artifactId>
                        <version>${version.maven.site}</version>
                        <configuration>
                            <reportPlugins combine.children="append">
                                <plugin>
                                    <groupId>org.apache.maven.plugins</groupId>
                                    <artifactId>maven-jxr-plugin</artifactId>
                                    <version>${version.maven.jxr}</version>
                                </plugin>
                                <plugin>
                                    <groupId>org.apache.maven.plugins</groupId>
                                    <artifactId>maven-surefire-report-plugin</artifactId>
                                    <version>${version.maven.surefire}</version>
                                    <configuration>
                                        <linkXRef>true</linkXRef>
                                    </configuration>
                                </plugin>
                                <plugin>
                                    <groupId>org.apache.maven.plugins</groupId>
                                    <artifactId>maven-checkstyle-plugin</artifactId>
                                    <version>${version.maven.checkstyle}</version>
                                    <configuration>
                                        <linkXRef>true</linkXRef>
                                        <cacheFile>src/analysis/resources/checkstyle-cachefile</cacheFile>
                                        <configLocation>src/analysis/resources/checkstyle-light.xml</configLocation>
                                        <suppressionsLocation>src/analysis/resources/suppressions.xml</suppressionsLocation>
                                    </configuration>
                                </plugin>
                                <plugin>
                                    <groupId>org.apache.maven.plugins</groupId>
                                    <artifactId>maven-pmd-plugin</artifactId>
                                    <version>${version.maven.pmd}</version>
                                    <configuration>
                                        <linkXRef>true</linkXRef>
                                        <sourceEncoding>utf-8</sourceEncoding>
                                        <failOnViolation>true</failOnViolation>
                                        <targetJdk>${jdk.target}</targetJdk>
                                        <rulesets>
                                            <ruleset>src/analysis/resources/pmd-ruleset.xml</ruleset>
                                        </rulesets>
                                        <excludes>
                                            <exclude>**/*_.java</exclude>
                                            <exclude>**/generated/*.java</exclude>
                                        </excludes>
                                    </configuration>
                                </plugin>
                                 <plugin>
                                    <groupId>org.codehaus.mojo</groupId>
                                    <artifactId>findbugs-maven-plugin</artifactId>
                                    <version>${version.maven.findbugs}</version>
                                    <configuration>
                                        <findbugsXmlOutput>true</findbugsXmlOutput>
                                        <excludeFilterFile>src/analysis/resources/findbugs-exclusion.xml</excludeFilterFile>
                                    </configuration>
                                </plugin>
                            </reportPlugins>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
