<project>
   <parent>
      <groupId>org.exoplatform.platform</groupId>
      <artifactId>exo.platform.commons.comet</artifactId>
      <version>3.0.0-CR01-SNAPSHOT</version>
   </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>exo.platform.commons.comet.service</artifactId>
    <name>eXo Platform Commons Comet Service</name>
    <packaging>jar</packaging>
   
   
   <dependencies>
      <dependency>
         <groupId>javax.ws.rs</groupId>
         <artifactId>jsr311-api</artifactId>
      </dependency>
      <dependency>
         <groupId>org.exoplatform.kernel</groupId>
         <artifactId>exo.kernel.container</artifactId>
      </dependency>
      <dependency>
         <groupId>org.exoplatform.kernel</groupId>
         <artifactId>exo.kernel.component.common</artifactId>
       </dependency>
      <dependency>
         <groupId>org.exoplatform.ws</groupId>
         <artifactId>exo.ws.frameworks.json</artifactId>
      </dependency>
      <dependency>
         <groupId>org.exoplatform.ws</groupId>
         <artifactId>exo.ws.commons</artifactId>
      </dependency>
      <dependency>
         <groupId>org.exoplatform.ws</groupId>
         <artifactId>exo.ws.rest.core</artifactId>
      </dependency>
      <dependency>
         <groupId>org.mortbay.jetty</groupId>
         <artifactId>cometd-bayeux</artifactId>
      </dependency>
      <dependency>
         <groupId>org.codehaus.cargo</groupId>
         <artifactId>cargo-core-api-container</artifactId>
      </dependency>
      <dependency>
         <groupId>org.codehaus.cargo</groupId>
         <artifactId>cargo-core-api-generic</artifactId>
      </dependency>
      <dependency>
         <groupId>org.codehaus.cargo</groupId>
         <artifactId>cargo-core-container-tomcat</artifactId>
      </dependency>
      <dependency>
         <groupId>org.codehaus.cargo</groupId>
         <artifactId>cargo-core-container-jetty</artifactId>
      </dependency>
      
       <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.5.6</version>
         </dependency>

         <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.5.6</version>
         </dependency>

         <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.14</version>
         </dependency>

      
   </dependencies>
   <build>
      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.3</version>
            <executions>
               <execution>
                  <id>mkdir</id>
                  <goals>
                     <goal>run</goal>
                  </goals>
                  <phase>test-compile</phase>
                  <configuration>
                     <tasks>
                        <echo>create directory</echo>
                        <mkdir dir="${project.build.directory}/logs" />
                        <mkdir dir="${project.build.directory}/jetty" />
                     </tasks>
                  </configuration>
               </execution>
               <execution>
                  <id>0</id>
                  <goals>
                     <goal>run</goal>
                  </goals>
                  <phase>test-compile</phase>
                  <configuration>
                     <tasks>
                        <echo>copy files</echo>
                        <jar destfile="${project.build.directory}/test/${artifactId}-${version}.jar" basedir="${project.build.directory}/classes" />
                        <copy file="${basedir}/src/test/resources/jetty/exo-configuration.xml" todir="${project.build.directory}/jetty" />
                     </tasks>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
               <excludes>
                  <exclude>**/LocalCometdTest.java</exclude>
               </excludes>
               <systemProperties>
                  <property>
                     <name>testPath</name>
                     <value>${basedir}</value>
                  </property>
                  <property>
                     <name>mock.portal.dir</name>
                     <value>${war.dir}</value>
                  </property>
                  <property>
                     <name>maven.exoplatform.dir</name>
                     <value>${war.dir}</value>
                  </property>
                  <property>
                     <name>exo.test.cargo.skip</name>
                     <value>${exo.test.cargo.skip}</value>
                  </property>
                  <property>
                     <name>localrep</name>
                     <value>${localRepository}</value>
                  </property>
               </systemProperties>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
               <execution>
                  <id>copy-dependencies</id>
                  <phase>test-compile</phase>
                  <goals>
                     <goal>copy-dependencies</goal>
                  </goals>
                  <configuration>
                     <outputDirectory>${project.build.directory}/libs</outputDirectory>
                     <useRepositoryLayout>false</useRepositoryLayout>
                     <excludeTransitive>true</excludeTransitive>
                  </configuration>
               </execution>
               <execution>
                  <id>copy-jar</id>
                  <phase>test-compile</phase>
                  <goals>
                     <goal>copy</goal>
                  </goals>
                  <configuration>
                     <artifactItems>
                        <artifactItem>
                           <groupId>javax.ws.rs</groupId>
                           <artifactId>jsr311-api</artifactId>
                           <version>1.0</version>
                        </artifactItem>
                        <artifactItem>
                           <groupId>javax.xml.bind</groupId>
                           <artifactId>jaxb-api</artifactId>
                           <version>2.1</version>
                        </artifactItem>
                        <artifactItem>
                           <groupId>com.sun.xml.bind</groupId>
                           <artifactId>jaxb-impl</artifactId>
                           <version>2.1.7</version>
                        </artifactItem>
                        <artifactItem>
                           <groupId>javax.activation</groupId>
                           <artifactId>activation</artifactId>
                           <version>1.1</version>
                        </artifactItem>
                        <artifactItem>
                           <groupId>commons-fileupload</groupId>
                           <artifactId>commons-fileupload</artifactId>
                           <!-- <version>1.2.1</version>-->
                           <version>1.0</version>
                        </artifactItem>
                        <artifactItem>
                           <groupId>org.exoplatform.kernel</groupId>
                           <artifactId>exo.kernel.container</artifactId>
                           <version>${org.exoplatform.kernel.version}</version>
                        </artifactItem>
                        <artifactItem>
                           <groupId>org.exoplatform.kernel</groupId>
                           <artifactId>exo.kernel.component.common</artifactId>
                           <version>${org.exoplatform.kernel.version}</version>
                        </artifactItem>
                        <artifactItem>
                           <groupId>org.exoplatform.ws</groupId>
                           <artifactId>exo.ws.frameworks.json</artifactId>
                           <version>${org.exoplatform.ws.version}</version>
                        </artifactItem>
                        <artifactItem>
                           <groupId>org.exoplatform.ws</groupId>
                           <artifactId>exo.ws.commons</artifactId>
                           <version>${org.exoplatform.ws.version}</version>
                        </artifactItem>
                        <artifactItem>
                           <groupId>org.mortbay.jetty</groupId>
                           <artifactId>cometd-api</artifactId>
                           <version>0.9.20080221</version>
                        </artifactItem>
                        <artifactItem>
                           <groupId>org.mortbay.jetty</groupId>
                           <artifactId>cometd-bayeux</artifactId>
                           <version>6.1.11</version>
                        </artifactItem>
                        <artifactItem>
                           <groupId>org.mortbay.jetty</groupId>
                           <artifactId>jetty-util</artifactId>
                           <version>6.1.11</version>
                        </artifactItem>
                        <artifactItem>
                           <groupId>org.codehaus.cargo</groupId>
                           <artifactId>cargo-core-api-container</artifactId>
                           <version>0.9</version>
                        </artifactItem>
                        <artifactItem>
                           <groupId>org.codehaus.cargo</groupId>
                           <artifactId>cargo-core-api-generic</artifactId>
                           <version>0.9</version>
                        </artifactItem>
                        <artifactItem>
                           <groupId>org.codehaus.cargo</groupId>
                           <artifactId>cargo-core-container-tomcat</artifactId>
                           <version>0.9</version>
                        </artifactItem>
                        <artifactItem>
                           <groupId>picocontainer</groupId>
                           <artifactId>picocontainer</artifactId>
                           <version>1.1</version>
                           <type>jar</type>
                        </artifactItem>
                        <artifactItem>
                           <groupId>javax.servlet</groupId>
                           <artifactId>servlet-api</artifactId>
                           <version>2.5</version>
                           <type>jar</type>
                        </artifactItem>
                        <artifactItem>
                           <groupId>org.jibx</groupId>
                           <artifactId>jibx-run</artifactId>
                           <version>1.2.1</version>
                           <type>jar</type>
                        </artifactItem>
                        <artifactItem>
                           <groupId>com.sun.xml.stream</groupId>
                           <artifactId>sjsxp</artifactId>
                           <version>1.0</version>
                           <type>jar</type>
                        </artifactItem>
                        <artifactItem>
                           <groupId>commons-logging</groupId>
                           <artifactId>commons-logging</artifactId>
                           <version>1.0.4</version>
                           <type>jar</type>
                        </artifactItem>
                        <artifactItem>
                           <groupId>org.exoplatform.kernel</groupId>
                           <artifactId>exo.kernel.commons</artifactId>
                           <version>${org.exoplatform.kernel.version}</version>
                           <type>jar</type>
                        </artifactItem>
                        <artifactItem>
                           <groupId>quartz</groupId>
                           <artifactId>quartz</artifactId>
                           <version>1.5.0-RC2</version>
                           <type>jar</type>
                        </artifactItem>
                        <artifactItem>
                           <groupId>javax.servlet</groupId>
                           <artifactId>servlet-api</artifactId>
                           <version>2.5</version>
                           <type>jar</type>
                        </artifactItem>
                        <artifactItem>
                           <groupId>org.exoplatform.ws</groupId>
                           <artifactId>exo.ws.frameworks.servlet</artifactId>
                           <version>${org.exoplatform.ws.version}</version>
                        </artifactItem>
                        <artifactItem>
                           <groupId>org.exoplatform.comet</groupId>
                           <artifactId>exo-comet-ext</artifactId>
                           <version>${org.exoplatform.comet.version}</version>
                        </artifactItem>
                        <artifactItem>
                           <groupId>org.exoplatform.ws</groupId>
                           <artifactId>exo.ws.rest.core</artifactId>
                           <version>${org.exoplatform.ws.version}</version>
                        </artifactItem>
                        <artifactItem>
                           <groupId>stax</groupId>
                           <artifactId>stax-api</artifactId>
                           <version>1.0</version>
                        </artifactItem>
                         <artifactItem>
                                     <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.5.6</version>
	    </artifactItem>

		<artifactItem>
                <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.5.6</version>
	    </artifactItem>

	    <artifactItem>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.14</version>
         </artifactItem>
         
         
         <artifactItem>
      <groupId>javax.ws.rs</groupId>
      <artifactId>jsr311-api</artifactId>
      <version>1.0</version>
      </artifactItem>    

                     </artifactItems>
                     <outputDirectory>${project.build.directory}/test</outputDirectory>
                  </configuration>
               </execution>
               <execution>
                  <id>copy-war</id>
                  <phase>generate-test-sources</phase>
                  <goals>
                     <goal>copy</goal>
                  </goals>
                  <configuration>
                     <artifactItems>
                        <artifactItem>
                           <groupId>org.exoplatform.comet</groupId>
                           <artifactId>exo-comet-ext-webapp-rest</artifactId>
                           <version>${org.exoplatform.comet.version}</version>
                           <type>war</type>
                           <outputDirectory>${project.build.directory}/test/war</outputDirectory>
                           <destFileName>rest.war</destFileName>
                        </artifactItem>
                        <artifactItem>
                           <groupId>org.exoplatform.comet</groupId>
                           <artifactId>exo-comet-ext-webapp-comet</artifactId>
                           <version>${org.exoplatform.comet.version}</version>
                           <type>war</type>
                           <outputDirectory>${project.build.directory}/test/war</outputDirectory>
                           <destFileName>cometd.war</destFileName>
                        </artifactItem>
                     </artifactItems>
                  </configuration>
               </execution>
               <execution>
                  <id>copy-war-jetty</id>
                  <phase>generate-test-sources</phase>
                  <goals>
                     <goal>copy</goal>
                  </goals>
                  <configuration>
                     <artifactItems>
                        <artifactItem>
                           <groupId>org.exoplatform.comet</groupId>
                           <artifactId>exo-comet-ext-webapp-rest</artifactId>
                           <version>${org.exoplatform.comet.version}</version>
                           <type>war</type>
                           <outputDirectory>${project.build.directory}/jetty/test/war</outputDirectory>
                           <destFileName>rest.war</destFileName>
                        </artifactItem>
                        <artifactItem>
                           <groupId>org.exoplatform.comet</groupId>
                           <artifactId>exo-comet-ext-webapp-comet</artifactId>
                           <version>${org.exoplatform.comet.version}</version>
                           <type>war</type>
                           <outputDirectory>${project.build.directory}/jetty/test/war</outputDirectory>
                           <destFileName>cometd.war</destFileName>
                        </artifactItem>
                     </artifactItems>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>maven-jetty-plugin</artifactId>
            <version>6.1.11</version>
            <configuration>
               <scanIntervalSeconds>10</scanIntervalSeconds>
               <stopKey>foo</stopKey>
               <stopPort>9999</stopPort>
               <tmpDir>target/not/necessary</tmpDir>
               <!--webDefaultXml>src/test/resources/webdefault.xml</webDefaultXml>
     <overrideWebXml>src/test/resources/override-web.xml</overrideWebXml-->
               <webAppSourceDirectory>src/test/resources/jetty</webAppSourceDirectory>
               <jettyConfig>src/test/resources/jetty/jetty.xml</jettyConfig>
               <requestLog implementation="org.mortbay.jetty.NCSARequestLog">
                  <filename>target/yyyy_mm_dd.request.log</filename>
                  <retainDays>90</retainDays>
                  <append>true</append>
                  <extended>false</extended>
                  <logTimeZone>GMT</logTimeZone>
               </requestLog>
            </configuration>
            <executions>
               <execution>
                  <id>start-jetty</id>
                  <phase>test-compile</phase>
                  <goals>
                     <goal>run</goal>
                  </goals>
                  <configuration>
                     <scanIntervalSeconds>0</scanIntervalSeconds>
                     <daemon>true</daemon>
                  </configuration>
               </execution>
               <execution>
                  <id>stop-jetty</id>
                  <phase>post-integration-test</phase>
                  <goals>
                     <goal>stop</goal>
                  </goals>
               </execution>
            </executions>
            <dependencies>
               <dependency>
                  <groupId>javax.ws.rs</groupId>
                  <artifactId>jsr311-api</artifactId>
                  <version>1.0</version>
               </dependency>
               <dependency>
                  <groupId>javax.xml.bind</groupId>
                  <artifactId>jaxb-api</artifactId>
                  <version>2.1</version>
               </dependency>
               <dependency>
                  <groupId>com.sun.xml.bind</groupId>
                  <artifactId>jaxb-impl</artifactId>
                  <version>2.1.7</version>
               </dependency>
               <!--dependency>
	  <groupId>javax.activation</groupId>
	  <artifactId>activation</artifactId>
	  <version>1.1</version>
	</dependency-->
               <dependency>
                  <groupId>commons-fileupload</groupId>
                  <artifactId>commons-fileupload</artifactId>
                  <!-- <version>1.2.1</version>-->
                  <version>1.0</version>
               </dependency>
               <dependency>
                  <groupId>org.exoplatform.ws</groupId>
                  <artifactId>exo.ws.rest.core</artifactId>
                  <version>${org.exoplatform.ws.version}</version>
               </dependency>
               <dependency>
                  <groupId>org.exoplatform.comet</groupId>
                  <artifactId>exo-comet-service</artifactId>
                  <version>${org.exoplatform.comet.version}</version>
               </dependency>
               <dependency>
                  <groupId>org.exoplatform.comet</groupId>
                  <artifactId>exo-comet-ext</artifactId>
                  <version>${org.exoplatform.comet.version}</version>
               </dependency>
               <dependency>
                  <groupId>org.exoplatform.kernel</groupId>
                  <artifactId>exo.kernel.container</artifactId>
                  <version>${org.exoplatform.kernel.version}</version>
               </dependency>
               <dependency>
                  <groupId>org.exoplatform.kernel</groupId>
                  <artifactId>exo.kernel.component.common</artifactId>
                  <version>${org.exoplatform.kernel.version}</version>
               </dependency>
               <dependency>
                  <groupId>org.exoplatform.ws</groupId>
                  <artifactId>exo.ws.frameworks.json</artifactId>
                  <version>${org.exoplatform.ws.version}</version>
               </dependency>
               <dependency>
                  <groupId>org.exoplatform.ws</groupId>
                  <artifactId>exo.ws.frameworks.servlet</artifactId>
                  <version>${org.exoplatform.ws.version}</version>
               </dependency>
               <dependency>
                  <groupId>org.exoplatform.ws</groupId>
                  <artifactId>exo.ws.commons</artifactId>
                  <version>${org.exoplatform.ws.version}</version>
               </dependency>
               <dependency>
                  <groupId>org.mortbay.jetty</groupId>
                  <artifactId>cometd-bayeux</artifactId>
                  <version>6.1.11</version>
               </dependency>
               <dependency>
                  <groupId>javax.servlet</groupId>
                  <artifactId>servlet-api</artifactId>
                  <version>2.5</version>
                  <type>jar</type>
               </dependency>
            </dependencies>
         </plugin>
      </plugins>
   </build>
</project>
