pom.xml revision 9414015dda290f99570edc01b6dbe98f0f4c49c7
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
~
~ Copyright (c) 2011-2012 ForgeRock AS. All Rights Reserved
~
~ The contents of this file are subject to the terms
~ of the Common Development and Distribution License
~ (the License). You may not use this file except in
~ compliance with the License.
~
~ You can obtain a copy of the License at
~ http://forgerock.org/license/CDDLv1.0.html
~ See the License for the specific language governing
~ permission and limitations under the License.
~
~ When distributing Covered Code, include this CDDL
~ Header Notice in each file and include the License file
~ at http://forgerock.org/license/CDDLv1.0.html
~ If applicable, add the following below the CDDL Header,
~ with the fields enclosed by brackets [] replaced by
~ your own identifying information:
~ "Portions Copyrighted [year] [name of copyright owner]"
-->
<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>
<artifactId>openidm-project</artifactId>
<groupId>org.forgerock.openidm</groupId>
<version>2.1.0-SNAPSHOT</version>
</parent>
<artifactId>openidm-ui-ria</artifactId>
<name>OpenIDM RIA Web UI</name>
<packaging>js</packaging>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jquery-amd</artifactId>
<type>js</type>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jstestrunner</groupId>
<artifactId>jstestrunner-junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.servicemix.bundles</groupId>
<artifactId>org.apache.servicemix.bundles.rhino</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>${basedir}/src/main/js</directory>
</resource>
<resource>
<directory>${basedir}/src/main/resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>${basedir}/src/test/js</directory>
</testResource>
<testResource>
<directory>${basedir}/src/test/resources</directory>
</testResource>
</testResources>
<extensions>
<extension>
<groupId>org.codehaus.mojo</groupId>
<artifactId>javascript-maven-plugin</artifactId>
<version>${javascript.maven.plugin.version}</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jslint-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/libs/mustache.js</exclude>
<exclude>**/order.js</exclude>
<exclude>**/*Test.js</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>Optimized UI</id>
<activation>
<property>
<name>openidm.ui.optimize</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-installed</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>rhino</includeGroupIds>
<outputDirectory>target/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>js/css optimization</id>
<phase>prepare-package</phase>
<configuration>
<target name="optimize">
<path id="class.path">
<fileset dir="target/lib">
<include name="**/*.jar" />
</fileset>
</path>
<echo message="Running optimize." />
<property name="requirejs.dir" value="${basedir}/src/main/optimization" />
<java classname="org.mozilla.javascript.tools.shell.Main"
failonerror="true">
<classpath refid="class.path" />
<arg value="${requirejs.dir}/r.js" />
<arg value="-o" />
<arg value="${requirejs.dir}/app.build.js" />
</java>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/zip-optimized.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>zip-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>Non optimized UI</id>
<activation>
<property>
<name>!openidm.ui.optimize</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/zip-non-optimized.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>zip-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>Without qunit tests</id>
<activation>
<property>
<name>!openidm.qunit.test</name>
</property>
</activation>
<properties>
<skipTests>true</skipTests>
</properties>
</profile>
<profile>
<id>With qunit tests</id>
<activation>
<property>
<name>openidm.qunit.test</name>
</property>
</activation>
<properties>
<skipTests>false</skipTests>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>process-resources</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeGroupIds>org.codehaus.mojo</includeGroupIds>
<includeArtifactIds>qunit-amd</includeArtifactIds>
<outputDirectory>
${project.build.directory}/test-classes/js
</outputDirectory>
<useRepositoryLayout>true</useRepositoryLayout>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<description>Web UI realized as a rich internet application created primaraly using JS. This module contains resources like java scripts, html files, css styles. Outcome of this module build is a zip file containing resouces deployable on any web server.
Build remarks:
If -Dopenidm.ui.optimize parameter is used during the build, target resources will be optimized. Use this during the release build.</description>
</project>