<?xml version="1.0"?>

<!--
  /*
  * Copyright 2001-2005 The Apache Software Foundation.
  *
  * 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">

  <parent>
    <groupId>com.devspan.mojo.javascript</groupId>
    <artifactId>javascript-maven-tools</artifactId>
    <version>0.9.3</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <groupId>com.devspan.mojo.javascript</groupId>
  <artifactId>javascript-maven-plugin</artifactId>
  <packaging>maven-plugin</packaging>
  <name>Javascript Maven Plugin</name>
  <url>http://mojo.codehaus.org/javascript-maven-tools/javascript-maven-plugin/</url>

  <build>
    <defaultGoal>install</defaultGoal>
    <plugins>
      <plugin>
        <groupId>org.codehaus.modello</groupId>
        <artifactId>modello-maven-plugin</artifactId>
        <version>1.0.1</version>
        <executions>
          <execution>
            <id>descriptor</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>xpp3-reader</goal>
              <goal>java</goal>
              <goal>xsd</goal>
            </goals>
            <configuration>
              <models>
                <model>src/main/mdo/assembler.mdo</model>
              </models>
              <version>1.0.0</version>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>2.5</version>
        </plugin>      
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>run-its</id>
      <activation>
        <property>
          <name>skipTests</name>
          <value>!true</value>
        </property>
      </activation>      
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-install-plugin</artifactId>
            <version>2.3</version>
            <executions>
              <execution>
                 <id>integration-test</id>
                 <phase>pre-integration-test</phase>
                 <goals>
                   <goal>install-file</goal>
                 </goals>
                 <configuration>
                   <file>${basedir}/src/test/it-resources/prototype-1.5.1.1-SNAPSHOT.jar</file>
                   <groupId>org.prototypejs</groupId>
                   <artifactId>prototype</artifactId>
                   <version>1.5.1.1-SNAPSHOT</version>
                   <packaging>jar</packaging>
                   <generatePom>true</generatePom>
                   <createChecksum>true</createChecksum>
                   <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
                   <localRepositoryId>it-local-repo</localRepositoryId>
                 </configuration>
               </execution>            
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-invoker-plugin</artifactId>
            <version>1.3</version>
            <configuration>
              <debug>true</debug>
              <projectsDirectory>src/it</projectsDirectory>
              <pomIncludes>
				<pomInclude>compile/*/pom.xml</pomInclude>
                <pomInclude>test-compile/*/pom.xml</pomInclude>
				<pomInclude>qunit/*/pom.xml</pomInclude>
				<pomInclude>webapp-compile/*/pom.xml</pomInclude>
				<pomInclude>inplace/*/pom.xml</pomInclude>
              </pomIncludes>



              <postBuildHookScript>verify</postBuildHookScript>
              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
              <goals>
                <goal>clean</goal>
                <goal>integration-test</goal>
              </goals>
              <settingsFile>src/it/settings.xml</settingsFile>
              <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>

            </configuration>
            <executions>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>install</goal>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>


  <dependencies>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>2.0</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-project</artifactId>
      <version>2.0</version>
    </dependency>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.4</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
    </dependency>    
    <dependency>
      <groupId>com.devspan.mojo.javascript</groupId>
      <artifactId>javascript-maven-archive</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>com.devspan.mojo.javascript</groupId>
      <artifactId>javascript-compressor-api</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>com.devspan.mojo.javascript</groupId>
      <artifactId>yahooui-compressor</artifactId>
      <version>${project.version}</version>
    </dependency>	
    <dependency>
      <groupId>commons-jxpath</groupId>
      <artifactId>commons-jxpath</artifactId>
      <version>1.2</version>
      <exclusions>
        <exclusion>
          <groupId>javax.servlet</groupId>
          <artifactId>servlet-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>ant</groupId>
          <artifactId>ant-optional</artifactId>
        </exclusion>
        <exclusion>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

	<dependency>
      <groupId>rhino</groupId>
      <artifactId>js</artifactId>
      <version>1.7R2</version>
	</dependency>

	<!-- qunit -->
	<dependency>
      <groupId>com.devspan.vendor.envjs</groupId>
      <artifactId>envjs-rhino</artifactId>
      <version>[1.2,1.3)</version>
	</dependency>
		<dependency>
      <groupId>com.devspan.vendor.jquery</groupId>
      <artifactId>qunit</artifactId>
      <version>[1.0,1.1)</version>
	</dependency>
	
<dependency>
      <groupId>com.devspan.vendor.jquery</groupId>
      <artifactId>jquery</artifactId>
      <version>[1.4,1.5)</version>
	</dependency>




    <!-- jsUnit Mojo -->
    <dependency>
      <groupId>net.jsunit</groupId>
      <artifactId>jsunit</artifactId>
      <version>2.1.4</version>
    </dependency>
    <dependency>
      <groupId>net.jsunit</groupId>
      <artifactId>jsunit-testRunner</artifactId>
      <version>2.1.4</version>
      <type>jar</type>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.surefire</groupId>
      <artifactId>surefire-junit</artifactId>
      <version>2.4.3</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.2</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-testing</groupId>
      <artifactId>maven-plugin-testing-harness</artifactId>
      <version>1.2</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

</project>
