<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>
		<artifactId>impl-parent</artifactId>
		<groupId>org.richfaces.framework</groupId>
		<version>3.2.0.CR3</version>
		<relativePath>../impl-parent/pom.xml</relativePath>
		</parent>
	-->
	<parent>
		<artifactId>framework</artifactId>
		<groupId>org.richfaces</groupId>
		<version>3.2.0.CR3</version>
	</parent>
	<modelVersion>4.0.0</modelVersion>
	<groupId>org.richfaces.framework</groupId>
	<artifactId>richfaces-impl</artifactId>
	<version>3.2.0.CR3</version>
	<name>Java Server Faces AJAX framework implementation</name>
	<build>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
			</resource>
			<resource>
				<directory>target/javascript</directory>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>javacc-maven-plugin</artifactId>
				<version>2.4</version>
				<executions>
					<execution>
						<goals>
							<goal>javacc</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<executions>
					<execution>
						<id>javascript</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<tasks>
								<ant antfile="${basedir}/generatescript.xml" inheritRefs="true">
									<target name="assembly" />
									<property name="target-dir" value="${project.build.directory}/javascript">
									</property>
								</ant>
							</tasks>
							<resourceRoot>
								${project.build.directory}/javascript
							</resourceRoot>
						</configuration>
					</execution>
				</executions>
			</plugin>
			      <plugin>
        <groupId>org.richfaces.cdk</groupId>
        <artifactId>maven-javascript-plugin</artifactId>
        <version>${project.version}</version>
        <executions> 
          <execution>
            <goals>
              <goal>compress</goal>
            </goals>
        <configuration>
          <nosuffix>false</nosuffix>
          <outputDirectory>${project.build.directory}/compressed/</outputDirectory>
          <aggregations>
            <aggregation>
              <!-- remove files after aggregation (default: false)
              <removeIncluded>true</removeIncluded>
              -->
              <!-- insert new line after each concatenation (default: false) -->
              <insertNewLine>true</insertNewLine>
              <output>${project.build.outputDirectory}/org/ajax4jsf/framework.pack.js</output>
              <!-- files to include, path relative to output's directory or absolute path-->
              <includes>
                <include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/prototype-min.js</include>
                <include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/AJAX-min.js</include>
                <include>${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/scriptaculous/scriptaculous-min.js</include>
                <include>${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/jquery/jquery-min.js</include>
                <include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/dnd-min.js</include>
                <include>**/*-min.js</include>
              </includes>
              <!-- files to exclude, path relative to output's directory -->
              <excludes>
                <exclude>**/*.pack.js</exclude>
                <!-- exclude parts of the scriptaculous, so big file already included -->
                <exclude>**/scriptaculous/*.js</exclude>
                <exclude>**/extend-min.js</exclude>
                <exclude>**/jquery.jcarousel-min.js</exclude>
                <exclude>**/compressed.css</exclude>
              </excludes>
            </aggregation>
          </aggregations>
		<resources>
			<resource>
				<directory>target/javascript</directory>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
			</resource>
		</resources>
        </configuration>
            
          </execution>
          <execution>
            <id>jslint</id>
            <goals>
              <goal>jslint</goal>
            </goals>
            <phase>test</phase>
        <configuration>
		<includes><include>**/framework.pack.js</include></includes>
		<resources>
			<resource>
				<directory>${project.build.outputDirectory}</directory>
			</resource>
		</resources>
        </configuration>
            
          </execution>
        </executions>        
      </plugin>
		</plugins>
	</build>
	<profiles>
		<profile>
			<id>clover</id>
			<build>
				<plugins>
					<plugin>
						<groupId>com.atlassian.maven.plugins</groupId>
						<artifactId>maven-clover-plugin</artifactId>
						<configuration>
							<includesAllSourceRoots>
								false
							</includesAllSourceRoots>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
	<dependencies>
		<dependency>
			<groupId>opensymphony</groupId>
			<artifactId>oscache</artifactId>
			<version>2.3</version>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>nekohtml</groupId>
			<artifactId>nekohtml</artifactId>
			<version>0.9.5</version>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>commons-digester</groupId>
			<artifactId>commons-digester</artifactId>
			<version>1.8</version>
		</dependency>
		<dependency>
			<groupId>org.richfaces.framework</groupId>
			<artifactId>richfaces-api</artifactId>
			<version>3.2.0.CR3</version>
		</dependency>
	</dependencies>
</project>