<?xml version="1.0" encoding="UTF-8"?>
<!--
  JBoss, Home of Professional Open Source
  Copyright [2010], Red Hat, Inc., and individual contributors
  by the @authors tag. See the copyright.txt in the distribution for a
  full listing of individual contributors.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->
<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>org.jboss.seam.wicket</groupId>
      <artifactId>seam-wicket-parent</artifactId>
      <version>3.0.0.Final</version>
      <relativePath>../../pom.xml</relativePath>
   </parent>

   <artifactId>seam-wicket-example-numberguess</artifactId>
   <packaging>war</packaging>
   <name>Seam for Apache Wicket Numberguess example</name>
   <!-- url required for JAR Manifest -->
   <url>${project.parent.url}</url>

   <properties>
      <jboss.home>${env.JBOSS_HOME}</jboss.home>
      <jboss.domain>default</jboss.domain>
   </properties>

   <dependencies>

      <dependency>
         <groupId>org.jboss.seam.wicket</groupId>
         <artifactId>seam-wicket</artifactId>
         <scope>compile</scope>
         <exclusions>
           <exclusion>
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
           </exclusion>
         </exclusions>
      </dependency>

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

      <dependency>
         <groupId>org.jboss.seam.wicket</groupId>
         <artifactId>seam-wicket-mock</artifactId>
      </dependency>

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

      <dependency>
         <groupId>org.jboss.arquillian</groupId>
         <artifactId>arquillian-testng</artifactId>
         <version>1.0.0.Alpha4</version>
      </dependency>
      
      <!-- Test dependencies -->
      <dependency>
         <groupId>org.seleniumhq.selenium.client-drivers</groupId>
         <artifactId>selenium-java-client-driver</artifactId>
      </dependency>
      <dependency>
         <groupId>org.jboss.test</groupId>
         <artifactId>richfaces-selenium</artifactId>
      </dependency>
   </dependencies>

   <build>
      <finalName>wicket-numberguess</finalName>
      <!-- Override the resource filtering to support storing html alongside classes -->
      <resources>
         <resource>
            <filtering>false</filtering>
            <directory>src/main/resources</directory>
         </resource>
         <resource>
            <filtering>false</filtering>
            <directory>src/main/java</directory>
            <includes>
               <include>**</include>
            </includes>
            <excludes>
               <exclude>**/*.java</exclude>
            </excludes>
         </resource>
      </resources>
      <testResources>
         <testResource>
            <filtering>false</filtering>
            <directory>src/test/resources</directory>
            <includes>
               <include>**</include>
            </includes>
         </testResource>
         <testResource>
            <filtering>false</filtering>
            <directory>src/test/java</directory>
            <includes>
               <include>**</include>
            </includes>
            <excludes>
               <exclude>**/*.java</exclude>
            </excludes>
         </testResource>
      </testResources>

      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <configuration>
               <webResources>
                  <resource>
                     <directory>src/main/webapp/WEB-INF</directory>
                     <targetPath>WEB-INF</targetPath>
                     <includes>
                        <include>**/beans.xml</include>
                        <include>**/web.xml</include>
                     </includes>
                  </resource>
               </webResources>
            </configuration>
         </plugin>

         <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
               <skip>true</skip>
            </configuration>
         </plugin>
      </plugins>
   </build>

   <profiles>
      <profile>
         <id>distribution</id>
         <activation>
            <property>
               <name>release</name>
            </property>
         </activation>
         <build>
            <plugins>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-assembly-plugin</artifactId>
               </plugin>
            </plugins>
         </build>
      </profile>  
   
      <profile>
         <id>default</id>
         <activation>
            <activeByDefault>true</activeByDefault>
         </activation>
         <build>
            <plugins>
               <plugin>
                  <artifactId>maven-surefire-plugin</artifactId>
                  <configuration>
                     <skip>true</skip>
                  </configuration>
               </plugin>
            </plugins>
         </build>
      </profile>

      <!-- mvn clean test -Pitest-jetty-embedded -->
      <profile>
         <id>itest-jetty-embedded</id>
         <dependencies>
            <dependency>
               <groupId>org.jboss.arquillian.container</groupId>
               <artifactId>arquillian-jetty-embedded-7</artifactId>
            </dependency>

            <dependency>
               <groupId>org.eclipse.jetty</groupId>
               <artifactId>jetty-webapp</artifactId>
               <scope>test</scope>
            </dependency>

            <dependency>
               <groupId>org.eclipse.jetty</groupId>
               <artifactId>jetty-plus</artifactId>
               <scope>test</scope>
            </dependency>

            <dependency>
               <groupId>org.jboss.spec.javax.servlet.jsp</groupId>
               <artifactId>jboss-jsp-api_2.2_spec</artifactId>
               <scope>test</scope>
            </dependency>

            <dependency>
               <groupId>org.jboss.weld.servlet</groupId>
               <artifactId>weld-servlet</artifactId>
            </dependency>
         </dependencies>
         <build>
            <plugins>
               <plugin>
                  <artifactId>maven-surefire-plugin</artifactId>
                  <configuration>
                     <skip>false</skip>
                     <excludes>
                        <exclude>org/jboss/seam/wicket/example/numberguess/ftest/*.java</exclude>
                     </excludes>
                  </configuration>
               </plugin>
            </plugins>
            <testResources>
               <testResource>
                  <directory>${project.basedir}/src/main/webapp/WEB-INF</directory>
               </testResource>
               <testResource>
                  <directory>${project.basedir}/src/test/resources</directory>
               </testResource>
               <testResource>
                  <directory>${project.basedir}/src/test/resources-jetty</directory>
               </testResource>
            </testResources>
         </build>
      </profile>

      <!-- mvn clean test -Pitest-jbossas-remote -->
      <profile>
         <id>itest-jbossas-remote</id>
         <dependencies>
            <dependency>
               <groupId>org.jboss.arquillian.container</groupId>
               <artifactId>arquillian-jbossas-remote-6</artifactId>
            </dependency>
            <dependency>
               <groupId>org.jboss.jbossas</groupId>
               <artifactId>jboss-as-client</artifactId>
               <type>pom</type>
               <scope>test</scope>
            </dependency>
            <dependency>
               <groupId>org.jboss.weld</groupId>
               <artifactId>weld-core</artifactId>
               <scope>test</scope>
            </dependency>
         </dependencies>
         <build>
            <plugins>
               <plugin>
                  <artifactId>maven-surefire-plugin</artifactId>
                  <configuration>
                     <skip>false</skip>
                     <excludes>
                        <exclude>org/jboss/seam/wicket/example/numberguess/ftest/*.java</exclude>
                     </excludes>
                  </configuration>
               </plugin>
            </plugins>
            <testResources>
               <testResource>
                  <directory>${project.basedir}/src/main/webapp/WEB-INF</directory>
               </testResource>
               <testResource>
                  <directory>${project.basedir}/src/test/resources</directory>
               </testResource>
               <testResource>
                  <directory>${project.basedir}/src/test/resources-jbossas</directory>
               </testResource>
            </testResources>
         </build>
      </profile>

      <!-- mvn -Pjbossas jboss:hard-deploy -->
      <profile>
         <id>jbossas</id>
         <dependencies>
            <dependency>
               <groupId>org.slf4j</groupId>
               <artifactId>slf4j-api</artifactId>
               <scope>provided</scope>
            </dependency>
         </dependencies>
         <build>
            <plugins>
               <plugin>
                  <artifactId>maven-surefire-plugin</artifactId>
                  <configuration>
                     <skip>true</skip>
                  </configuration>
               </plugin>
               <plugin>
                  <groupId>org.codehaus.mojo</groupId>
                  <artifactId>jboss-maven-plugin</artifactId>
                  <configuration>
                     <jbossHome>${jboss.home}</jbossHome>
                     <serverName>${jboss.domain}</serverName>
                     <fileNames>
                        <fileName>${project.build.directory}/${project.build.finalName}.war</fileName>
                     </fileNames>
                  </configuration>
               </plugin>
            </plugins>
         </build>
      </profile>

      <!-- mvn -Pjetty jetty:run -->
      <profile>
         <id>jetty</id>
         <dependencies>
            <dependency>
               <groupId>org.jboss.weld.servlet</groupId>
               <artifactId>weld-servlet</artifactId>
            </dependency>

            <dependency>
               <groupId>org.jboss.spec.javax.annotation</groupId>
               <artifactId>jboss-annotations-api_1.1_spec</artifactId>
               <scope>provided</scope>
            </dependency>

            <!-- Dependencies for launching Jetty from within IDE -->
            <dependency>
               <groupId>org.mortbay.jetty</groupId>
               <artifactId>jetty</artifactId>
            </dependency>

            <dependency>
               <groupId>org.mortbay.jetty</groupId>
               <artifactId>jsp-2.1-jetty</artifactId>
            </dependency>

            <dependency>
               <groupId>org.mortbay.jetty</groupId>
               <artifactId>jetty-naming</artifactId>
            </dependency>

            <dependency>
               <groupId>org.mortbay.jetty</groupId>
               <artifactId>jetty-plus</artifactId>
            </dependency>
         </dependencies>
         <build>
            <plugins>
               <plugin>
                  <artifactId>maven-surefire-plugin</artifactId>
                  <configuration>
                     <skip>true</skip>
                  </configuration>
               </plugin>
               <plugin>
                  <groupId>org.codehaus.mojo</groupId>
                  <artifactId>build-helper-maven-plugin</artifactId>
                  <version>1.5</version>
                  <executions>
                     <execution>
                        <phase>process-sources</phase>
                        <configuration>
                           <sources>
                              <source>${project.basedir}/src/jetty/java</source>
                           </sources>
                        </configuration>
                        <goals>
                           <goal>add-source</goal>
                        </goals>
                     </execution>
                  </executions>
               </plugin>
               <plugin>
                  <groupId>org.mortbay.jetty</groupId>
                  <artifactId>maven-jetty-plugin</artifactId>
                  <!-- TODO move version to parent -->
                  <version>6.1.26</version>
                  <configuration>
                     <overrideWebXml>src/main/webapp/WEB-INF/jetty-web-fragment.xml</overrideWebXml>
                     <jettyEnvXml>src/main/webapp/WEB-INF/jetty-env.xml</jettyEnvXml>
                     <scanIntervalSeconds>3</scanIntervalSeconds>
                  </configuration>
               </plugin>
            </plugins>
         </build>
      </profile>
      <profile>
         <id>ftest</id>
      </profile>
   </profiles>
</project>
