<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.richfaces.sandbox.ui.bootstrap</groupId>
        <artifactId>bootstrap-parent</artifactId>
        <version>0.1.0.Final</version>
    </parent>

    <artifactId>bootstrap-ui</artifactId>
    <name>Richfaces UI Sandbox Components: bootstrap ui</name>

    <properties>
        <wro4j.run>true</wro4j.run>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.richfaces.ui</groupId>
            <artifactId>richfaces-components-ui</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.richfaces.core</groupId>
            <artifactId>richfaces-core-impl</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.richfaces.cdk</groupId>
            <artifactId>annotations</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec</groupId>
            <artifactId>jboss-javaee-web-6.0</artifactId>
            <version>3.0.1.Final</version>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.9.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/main/wro4j</source>
                                <source>${project.build.directory}/generated-sources/main/java</source>
                                <source>${project.build.directory}/generated-sources/main/resources</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <executions>
                    <execution>
                        <id>precompile-sources-for-cdk</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.richfaces.cdk</groupId>
                <artifactId>maven-cdk-plugin</artifactId>
                <executions>
                    <execution>
                        <id>cdk-generate-sources</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <templates>
                        <fileSet>
                            <directory>src/main/java</directory>
                            <includes>
                                <include>**/*.template.xml</include>
                            </includes>
                        </fileSet>
                    </templates>
                </configuration>
            </plugin>
            <plugin>
                <groupId>ro.isdc.wro4j</groupId>
                <artifactId>wro4j-maven-plugin</artifactId>
                <version>1.4.5</version>
                <configuration>
                    <contextFolder>${basedir}/src/main/resources/META-INF/resources</contextFolder>
                    <destinationFolder>${project.build.directory}/classes/META-INF/resources/org.richfaces/min</destinationFolder>
                    <wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
                </configuration>
                <executions>
                    <execution>
                        <id>rf-bootstrap-js</id>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <wroFile>${basedir}/src/main/wro4j/rf-bootstrap-js.xml</wroFile>
                            <extraConfigFile>${basedir}/src/main/wro4j/js-min.properties</extraConfigFile>
                            <targetGroups>rf-bootstrap-js</targetGroups>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>

        <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.richfaces.cdk</groupId>
                                        <artifactId>maven-cdk-plugin</artifactId>
                                        <versionRange>[4.3.0-SNAPSHOT,)</versionRange>
                                        <goals>
                                            <goal>generate</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <execute>
                                            <runOnIncremental>false</runOnIncremental>
                                        </execute>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        
    
        <!-- Profile for quick CDK turnaround using JRebel and CDK command-line generator -->
        <profile>
            <id>jrebel</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.zeroturnaround</groupId>
                        <artifactId>jrebel-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>generate-rebel-xml</id>
                                <phase>process-resources</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>wro4j</id>
            <activation>
                <property>
                    <name>wro4j.run</name>
                    <value>!false</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>ro.isdc.wro4j</groupId>
                        <artifactId>wro4j-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>rf-bootstrap-min</id>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <wroFile>${basedir}/src/main/wro4j/rf-bootstrap-css.xml</wroFile>
                                    <extraConfigFile>${basedir}/src/main/wro4j/less-min.properties</extraConfigFile>
                                    <targetGroups>rf-bootstrap-css</targetGroups>
                                </configuration>
                            </execution>
                            <execution>
                                <id>rf-bootstrap-responsive</id>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <wroFile>${basedir}/src/main/wro4j/rf-bootstrap-responsive.xml</wroFile>
                                    <extraConfigFile>${basedir}/src/main/wro4j/less-min.properties</extraConfigFile>
                                    <targetGroups>rf-bootstrap-responsive</targetGroups>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
