<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.Alpha2</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.7-SNAPSHOT</version.maven.checkstyle>
        <version.maven.pmd>2.5</version.maven.pmd>
        <version.maven.findbugs>2.3.2</version.maven.findbugs>
        <version.maven.cobertura>2.5</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>
            </testResource>
            <testResource>
                <directory>src/test/resources-glassfish</directory>
            </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>
    </build>

    <dependencies>

        <dependency>
            <groupId>org.jboss.weld</groupId>
            <artifactId>weld-core</artifactId>
        </dependency>

        <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.jboss.seam.solder</groupId>
            <artifactId>seam-solder</artifactId>
        </dependency>

        <!-- Tests -->

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit-dep</artifactId>
        </dependency>
        
        <dependency>
            <groupId>org.jboss.arquillian</groupId>
            <artifactId>arquillian-junit</artifactId>
        </dependency>
        
        <!-- TODO: Move to a profile -->
        
        <dependency>
            <groupId>org.jboss.arquillian.container</groupId>
            <artifactId>arquillian-glassfish-embedded-3.1</artifactId>
        </dependency>
        
        <dependency>
            <groupId>org.glassfish.extras</groupId>
            <artifactId>glassfish-embedded-all</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.derby</groupId>
            <artifactId>derby</artifactId>
        </dependency>

    </dependencies>

    <profiles>
        <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>
                    <!-- 
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>emma-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>instrumentation</id>
                                <phase>process-classes</phase>
                                <goals>
                                    <goal>instrument</goal>
                                </goals>
                                <configuration>
                                    <verbose>true</verbose>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>complete classpath for tests</id>
                                <phase>process-classes</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <tasks>
                                        <delete dir="${project.build.directory}/classes" />
                                        <mkdir dir="${project.build.directory}/classes" />
                                        <copy todir="${project.build.directory}/classes" overwrite="true">
                                            <fileset dir="${project.build.directory}/generated-classes/emma/classes">
                                                <include name="**/*" />
                                            </fileset>
                                        </copy>
                                    </tasks>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                     -->
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
