Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
file 185 lines (183 sloc) 7.676 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
<?xml version="1.0" encoding="UTF-8"?>

<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<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">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.xwiki.platform</groupId>
    <artifactId>xwiki-platform-core</artifactId>
    <version>6.2-SNAPSHOT</version>
  </parent>
  <artifactId>xwiki-platform-web</artifactId>
  <name>XWiki Platform - Web Resources</name>
  <packaging>war</packaging>
  <description>Web Resources for the XWiki platform</description>
  <properties>
    <!-- Don't run CLIRR on this module since there's no Java code. -->
    <xwiki.clirr.skip>true</xwiki.clirr.skip>
  </properties>
  <build>
    <plugins>
      <!-- Javascript and CSS files compression -->
      <plugin>
        <groupId>net.alchim31.maven</groupId>
        <artifactId>yuicompressor-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>compress</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <!-- Don't output in the default webapp location, since the war plugin will overwrite the files in there
with the original, uncompressed ones. -->
          <webappDirectory>${project.build.directory}/minimized</webappDirectory>
          <excludes>
            <!-- Exclude already minified files -->
            <exclude>**/*-min.js</exclude>
            <exclude>**/*-debug.js</exclude>
            <exclude>**/langs/*.js</exclude>
            <!-- Exclude files with complex Velocity code inside -->
            <!-- This one iterates over xobjects of type XWiki.SearchSuggestSourceClass -->
            <exclude>**/searchSuggest.js</exclude>
          </excludes>
          <aggregations>
            <!-- Aggregate the JavaScript code that is loaded on every page. -->
            <aggregation>
              <insertNewLine>true</insertNewLine>
              <inputDir>${project.build.directory}/minimized</inputDir>
              <output>${project.build.directory}/minimized/resources/js/xwiki/xwiki-min.js</output>
              <includes>
                <include>**/xwiki.js</include>
                <include>**/entityReference.js</include>
                <include>**/modalPopup.js</include>
                <include>**/jumpToPage.js</include>
                <include>**/confirmationBox.js</include>
                <include>**/confirmedAjaxRequest.js</include>
                <include>**/notification.js</include>
                <include>**/xlist.js</include>
                <include>**/suggest.js</include>
              </includes>
            </aggregation>
            <!-- Aggregate the CSS code that is loaded on every page. -->
            <aggregation>
              <insertNewLine>true</insertNewLine>
              <inputDir>${project.build.directory}/minimized</inputDir>
              <output>${project.build.directory}/minimized/resources/css/xwiki-min.css</output>
              <includes>
                <include>**/modalPopup.css</include>
                <include>**/jumpToPage.css</include>
                <include>**/confirmationBox.css</include>
                <include>**/notification.css</include>
                <include>**/suggest.css</include>
              </includes>
            </aggregation>
          </aggregations>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <webResources>
            <!-- Include License resources -->
            <resource>
              <directory>${project.build.directory}/maven-shared-archive-resources/META-INF</directory>
              <targetPath>META-INF</targetPath>
            </resource>
            <!-- Include version.properties file -->
            <resource>
              <directory>${basedir}/src/main/webInfResources</directory>
              <targetPath>WEB-INF</targetPath>
              <filtering>true</filtering>
            </resource>
            <!-- Add minified resources -->
            <resource>
              <directory>${project.build.directory}/minimized</directory>
              <targetPath>/</targetPath>
              <filtering>false</filtering>
            </resource>
          </webResources>
          <!-- Exclude the LICENSE/NOTICE files from the classes/ directory since we're including them in META-INF/ at
the root of the WAR -->
          <packagingExcludes>WEB-INF/classes/META-INF/**</packagingExcludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.github.searls</groupId>
        <artifactId>jasmine-maven-plugin</artifactId>
        <version>1.0.2-beta-5</version>
        <executions>
          <execution>
            <goals>
              <goal>test</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <sourceIncludes>
            <include>js/prototype/prototype.js</include>
            <include>uicomponents/widgets/list/xlist.js</include>
            <include>uicomponents/suggest/suggest.js</include>
            <include>uicomponents/model/entityReference.js</include>
          </sourceIncludes>
          <specIncludes>
            <include>spec/**/*.js</include>
          </specIncludes>
          <jsSrcDir>${project.basedir}/src/main/webapp/resources</jsSrcDir>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <!-- This debug profile should be used to avoid JS/CSS compression. This is useful when debugging XWiki for
example since we can put breakpoints in our browsers on the JS. -->
      <id>debug</id>
      <properties>
        <xwiki.minification.skip>true</xwiki.minification.skip>
      </properties>
      <build>
        <plugins>
          <plugin>
            <!-- Make sure the minimized dir exists, since it is expected by the war plugin and will not be created
in this profile -->
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <phase>prepare-package</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <tasks>
                    <mkdir dir="${project.build.directory}/minimized" />
                  </tasks>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
Something went wrong with that request. Please try again.