<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.Alpha5</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>
        <project.parent.url>${project.artifactId}</project.parent.url>
    </properties>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
        <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>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<configuration>
						<argLine>-Xms128m -Xmx1024m -XX:MaxPermSize=256m</argLine>
					</configuration>
				</plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.bsc.maven</groupId>
                <artifactId>maven-processor-plugin</artifactId>
                <version>2.0.7</version>
                <executions>
                    <execution>
                        <id>process-test</id>
                        <goals>
                            <goal>process-test</goal>
                        </goals>
                        <phase>generate-test-sources</phase>
                    </execution>
                </executions>
                <configuration>
                    <processors>
                        <processor>com.mysema.query.apt.jpa.JPAAnnotationProcessor</processor>
                        <processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
                    </processors>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.mysema.querydsl</groupId>
                        <artifactId>querydsl-apt</artifactId>
                        <version>${querydsl.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.hibernate</groupId>
                        <artifactId>hibernate-jpamodelgen</artifactId>
                        <version>1.2.0.Final</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </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>org.apache.geronimo.components</groupId>
            <artifactId>geronimo-transaction</artifactId>
            <version>3.1.1</version>
            <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>
        
        <dependency>
            <groupId>com.mysema.querydsl</groupId>
            <artifactId>querydsl-jpa</artifactId>
            <optional>true</optional>
            <exclusions>
                <exclusion>
                    <artifactId>slf4j-api</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Tests -->

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jboss.arquillian.junit</groupId>
            <artifactId>arquillian-junit-container</artifactId>
            <scope>test</scope>
        </dependency>
        
        <dependency>
            <groupId>org.jboss.arquillian.protocol</groupId>
            <artifactId>arquillian-protocol-servlet</artifactId>
            <scope>test</scope>
        </dependency>
    
        <dependency>
            <groupId>org.jboss.shrinkwrap.resolver</groupId>
            <artifactId>shrinkwrap-resolver-impl-maven</artifactId>
        </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>
                    <version>1.0.0.CR3</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.glassfish.main.extras</groupId>
                    <artifactId>glassfish-embedded-all</artifactId>
                    <version>3.1.2</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.hsqldb</groupId>
                    <artifactId>hsqldb</artifactId>
                    <scope>test</scope>
                </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>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <properties>
                <deploy.libs>true</deploy.libs>
            </properties>
        </profile>

        <profile>
            <id>arq-openejb-embedded</id>
            <build>
                <testResources>
                    <testResource>
                        <directory>src/test/resources</directory>
                    </testResource>
                    <testResource>
                        <directory>src/test/resources-openejb</directory>
                    </testResource>
                </testResources>
            </build>
            <dependencies>
                <dependency>
                    <groupId>org.apache.openejb</groupId>
                    <artifactId>arquillian-openejb-embedded-4</artifactId>
                    <version>4.5.0</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.apache.openejb</groupId>
                    <artifactId>openejb-core-hibernate</artifactId>
                    <version>4.5.0</version>
                    <type>pom</type>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <repositories>
                <repository>
                    <id>openejb</id>
                    <url>https://repository.apache.org/content/repositories/snapshots/</url>
                </repository>
            </repositories>
        </profile>
        
        <profile>
            <id>arq-tomee-embedded</id>
            <build>
                <testResources>
                    <testResource>
                        <directory>src/test/resources</directory>
                    </testResource>
                    <testResource>
                        <directory>src/test/resources-openejb</directory>
                    </testResource>
                </testResources>
            </build>
            <dependencies>
                <dependency>
                    <groupId>org.apache.openejb</groupId>
                    <artifactId>apache-tomee</artifactId>
                    <classifier>plus</classifier>
                    <type>zip</type>
                </dependency>
                <dependency>
                    <groupId>org.apache.openejb</groupId>
                    <artifactId>arquillian-tomee-embedded</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </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>
