Mirage2 POM cleanup/refactoring. Avoid duplication of plugin version numbers, and make it easier to change dependency versions.

This commit is contained in:
Tim Donohue
2014-09-12 15:05:20 -05:00
parent d267f8bf9c
commit 86d771cecb
3 changed files with 133 additions and 118 deletions

View File

@@ -1,12 +1,12 @@
<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"> <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> <modelVersion>4.0.0</modelVersion>
<groupId>org.dspace</groupId> <groupId>org.dspace</groupId>
<artifactId>dspace-xmlui-mirage2</artifactId> <artifactId>dspace-xmlui-mirage2</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<name>DSpace Mirage2 - src</name> <name>DSpace XML-UI Mirage2 Theme</name>
<description> <description>
This project generates an overlay war for inclusion in XMLUI using the overlay mechanism. DSpace Mirage2 Theme for the XMLUI (Cocoon based interface).
</description> </description>
<parent> <parent>
<groupId>org.dspace</groupId> <groupId>org.dspace</groupId>
@@ -15,74 +15,56 @@
<relativePath>..</relativePath> <relativePath>..</relativePath>
</parent> </parent>
<properties> <properties>
<!-- This is the path to the root [dspace-src] directory. --> <!-- This is the path to the root [dspace-src] directory. -->
<root.basedir>${basedir}/..</root.basedir> <root.basedir>${basedir}/..</root.basedir>
</properties>
</properties>
<build>
<filters>
<!-- Filter using the properties file defined by dspace-parent POM -->
<filter>${filters.file}</filter>
</filters>
<plugins>
<build>
<filters>
<!-- Filter using the properties file defined by dspace-parent POM -->
<filter>${filters.file}</filter>
</filters>
<plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId> <artifactId>maven-war-plugin</artifactId>
<configuration> <configuration>
<archiveClasses>false</archiveClasses> <archiveClasses>false</archiveClasses>
<warSourceExcludes>themes/**</warSourceExcludes> <warSourceExcludes>themes/**</warSourceExcludes>
<webResources> <webResources>
<resource> <resource>
<filtering>false</filtering> <filtering>false</filtering>
<directory>${basedir}/src/main/webapp</directory> <directory>${basedir}/src/main/webapp</directory>
</resource>
</resource> </webResources>
</configuration>
</webResources> <executions>
<overlays> <execution>
<!-- <phase>prepare-package</phase>
the priority of overlays is determined here </execution>
1.) default: anything in the current project has highest </executions>
2.) anything defined here has precedence in the order defined </plugin>
3.) any war found transitively in the dependencies will be applied <plugin>
next. the order is unpredictable. <groupId>com.mycila</groupId>
--> <artifactId>license-maven-plugin</artifactId>
<configuration>
</overlays> <!-- Exclude license check for essential config files, these files cannot have a license comment or Mirage 2 will not compile -->
</configuration> <excludes>
<executions> <exclude>**/*.json</exclude>
<execution> <exclude>**/*.LICENSE</exclude>
<phase>prepare-package</phase> <exclude>**/*.svg</exclude>
</execution> <exclude>**/readme.txt</exclude>
</executions> <exclude>**/.bowerrc</exclude>
</plugin> </excludes>
<plugin> <mapping>
<groupId>com.mycila</groupId> <!-- File extensions which are not recognized by license-maven-plugin:
<artifactId>license-maven-plugin</artifactId> *.hbs, *.scss -->
<configuration> <hbs>XML_STYLE</hbs>
<!-- Exclude license check for essential config files, these files cannot have a license comment or Mirage 2 will not compile --> <scss>JAVADOC_STYLE</scss>
<excludes> </mapping>
<exclude>**/*.json</exclude> </configuration>
<exclude>**/*.LICENSE</exclude> </plugin>
<exclude>**/readme.txt</exclude> </plugins>
<exclude>**/.bowerrc</exclude> </build>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
</dependencies>
</project> </project>

View File

@@ -4,9 +4,10 @@
<groupId>org.dspace.modules</groupId> <groupId>org.dspace.modules</groupId>
<artifactId>xmlui-mirage2</artifactId> <artifactId>xmlui-mirage2</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<name>DSpace Mirage2 :: local customisations</name> <name>DSpace XML-UI Mirage2 Theme :: Local Customisations</name>
<description> <description>
This project generates an overlay war for inclusion in XMLUI using the overlay mechanism. This project allows you to overlay your own local Mirage2 Theme customizations
on top of the default Mirage2 Theme provided with DSpace.
</description> </description>
<parent> <parent>
@@ -22,6 +23,11 @@
<grunt.environment>prod</grunt.environment> <grunt.environment>prod</grunt.environment>
<grunt.color.scheme>classic_mirage_color_scheme</grunt.color.scheme> <grunt.color.scheme>classic_mirage_color_scheme</grunt.color.scheme>
<mirage2.deps.included>true</mirage2.deps.included> <mirage2.deps.included>true</mirage2.deps.included>
<!-- Versions of build dependencies to be auto-installed when "mirage2.deps.included=true" -->
<sass.version>3.4.3</sass.version>
<compass.version>1.0.1</compass.version>
<node.version>0.10.31</node.version>
<npm.version>1.4.23</npm.version>
</properties> </properties>
<build> <build>
@@ -29,11 +35,21 @@
<!-- Filter using the properties file defined by dspace-parent POM --> <!-- Filter using the properties file defined by dspace-parent POM -->
<filter>${filters.file}</filter> <filter>${filters.file}</filter>
</filters> </filters>
<!-- Centrally manage the versions of all plugins used below -->
<pluginManagement>
<plugins>
<!-- This iterator plugin is used by all build <profiles> below -->
<plugin>
<groupId>com.soebes.maven.plugins</groupId>
<artifactId>iterator-maven-plugin</artifactId>
<version>0.3</version>
</plugin>
</plugins>
</pluginManagement>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId> <artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions> <executions>
<execution> <execution>
<id>unpack-dependencies</id> <id>unpack-dependencies</id>
@@ -56,7 +72,6 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions> <executions>
<execution> <execution>
<goals> <goals>
@@ -106,7 +121,6 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId> <artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
<executions> <executions>
<execution> <execution>
<phase>validate</phase> <phase>validate</phase>
@@ -115,29 +129,18 @@
</goals> </goals>
<configuration> <configuration>
<tasks> <tasks>
<echoproperties> <echo>PATH=${env.PATH}</echo>
</echoproperties> <echo>GEM_PATH=${env.GEM_PATH}</echo>
<echo>${env.PATH}</echo> <echo>GEM_HOME=${env.GEM_HOME}</echo>
<echo>${env.GEM_PATH}</echo> <echo>mirage2.deps.included=${mirage2.deps.included}</echo>
<echo>${env.GEM_HOME}</echo> <echo>grunt.color.scheme=${grunt.color.scheme}</echo>
<echo>${mirage2.deps.included}</echo> <echo>grunt.environment=${grunt.environment}</echo>
<echo>${grunt.color.scheme}</echo> <echo>source=${basedir}/src/main/webapp/themes/</echo>
<echo>${grunt.environment}</echo>
<echo>${basedir}/src/main/webapp/themes/</echo>
</tasks> </tasks>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>1.9.2</version>
</dependency>
</dependencies>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId> <artifactId>maven-war-plugin</artifactId>
@@ -186,10 +189,11 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<!-- Faster build profile (enable with -Dmirage2.deps.included=true).
However you must manually install dependencies on your machine for this to work. -->
<profiles> <profiles>
<profile> <profile>
<id>mirage2-deps-preinstalled-fast</id> <id>mirage2-deps-preinstalled-fast</id>
@@ -200,11 +204,20 @@
</property> </property>
</activation> </activation>
<build> <build>
<!-- Centrally manage the versions of all plugins used by this profile -->
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.3.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins> <plugins>
<plugin> <plugin>
<groupId>com.soebes.maven.plugins</groupId> <groupId>com.soebes.maven.plugins</groupId>
<artifactId>iterator-maven-plugin</artifactId> <artifactId>iterator-maven-plugin</artifactId>
<version>0.3</version>
<executions> <executions>
<execution> <execution>
<phase>prepare-package</phase> <phase>prepare-package</phase>
@@ -218,7 +231,6 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin> </plugin>
<goal>copy-resources</goal> <goal>copy-resources</goal>
<configuration> <configuration>
@@ -239,7 +251,6 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin> </plugin>
<goal>copy-resources</goal> <goal>copy-resources</goal>
<configuration> <configuration>
@@ -260,7 +271,6 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId> <artifactId>exec-maven-plugin</artifactId>
<version>1.3.1</version>
</plugin> </plugin>
<goal>exec</goal> <goal>exec</goal>
<configuration> <configuration>
@@ -279,7 +289,6 @@
<plugin> <plugin>
<groupId>org.codehaus.mojo</groupId> <groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId> <artifactId>exec-maven-plugin</artifactId>
<version>1.3.1</version>
</plugin> </plugin>
<goal>exec</goal> <goal>exec</goal>
<configuration> <configuration>
@@ -306,6 +315,10 @@
</plugins> </plugins>
</build> </build>
</profile> </profile>
<!-- DEFAULT profile. Automatically installs all necessary dependencies (Node.js, etc.)
to a temp location EVERY time project is built. This results in a slower build, but
it doesn't require that you install these dependencies yourself. -->
<profile> <profile>
<id>mirage2-deps-included-slow</id> <id>mirage2-deps-included-slow</id>
<activation> <activation>
@@ -325,22 +338,36 @@
<dependency> <dependency>
<groupId>rubygems</groupId> <groupId>rubygems</groupId>
<artifactId>sass</artifactId> <artifactId>sass</artifactId>
<version>3.2.6</version> <version>${sass.version}</version>
<type>gem</type> <type>gem</type>
</dependency> </dependency>
<dependency> <dependency>
<groupId>rubygems</groupId> <groupId>rubygems</groupId>
<artifactId>compass</artifactId> <artifactId>compass</artifactId>
<version>0.12.2</version> <version>${compass.version}</version>
<type>gem</type> <type>gem</type>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
<!-- Centrally manage the versions of all plugins used by this profile -->
<pluginManagement>
<plugins>
<plugin>
<groupId>de.saumya.mojo</groupId>
<artifactId>gem-maven-plugin</artifactId>
<version>1.0.6</version>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>0.0.16</version>
</plugin>
</plugins>
</pluginManagement>
<plugins> <plugins>
<plugin> <plugin>
<groupId>de.saumya.mojo</groupId> <groupId>de.saumya.mojo</groupId>
<artifactId>gem-maven-plugin</artifactId> <artifactId>gem-maven-plugin</artifactId>
<version>1.0.0-rc</version>
<executions> <executions>
<execution> <execution>
<goals> <goals>
@@ -352,7 +379,6 @@
<plugin> <plugin>
<groupId>com.soebes.maven.plugins</groupId> <groupId>com.soebes.maven.plugins</groupId>
<artifactId>iterator-maven-plugin</artifactId> <artifactId>iterator-maven-plugin</artifactId>
<version>0.3</version>
<executions> <executions>
<execution> <execution>
<phase>prepare-package</phase> <phase>prepare-package</phase>
@@ -367,7 +393,6 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin> </plugin>
<goal>copy-resources</goal> <goal>copy-resources</goal>
<configuration> <configuration>
@@ -388,7 +413,6 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin> </plugin>
<goal>copy-resources</goal> <goal>copy-resources</goal>
<configuration> <configuration>
@@ -410,14 +434,13 @@
<plugin> <plugin>
<groupId>com.github.eirslett</groupId> <groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId> <artifactId>frontend-maven-plugin</artifactId>
<version>0.0.14</version>
</plugin> </plugin>
<goal>install-node-and-npm</goal> <goal>install-node-and-npm</goal>
<!--<phase>process-resources</phase>--> <!--<phase>process-resources</phase>-->
<configuration> <configuration>
<workingDirectory>${project.build.directory}/themes/@item@</workingDirectory> <workingDirectory>${project.build.directory}/themes/@item@</workingDirectory>
<nodeVersion>v0.10.18</nodeVersion> <nodeVersion>v${node.version}</nodeVersion>
<npmVersion>1.3.8</npmVersion> <npmVersion>${npm.version}</npmVersion>
</configuration> </configuration>
</pluginExecutor> </pluginExecutor>
<pluginExecutor> <pluginExecutor>
@@ -425,7 +448,6 @@
<plugin> <plugin>
<groupId>com.github.eirslett</groupId> <groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId> <artifactId>frontend-maven-plugin</artifactId>
<version>0.0.14</version>
</plugin> </plugin>
<goal>npm</goal> <goal>npm</goal>
<!--<phase>prepare-package</phase>--> <!--<phase>prepare-package</phase>-->
@@ -439,7 +461,6 @@
<plugin> <plugin>
<groupId>com.github.eirslett</groupId> <groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId> <artifactId>frontend-maven-plugin</artifactId>
<version>0.0.14</version>
</plugin> </plugin>
<goal>grunt</goal> <goal>grunt</goal>
<!--<phase>prepare-package</phase>--> <!--<phase>prepare-package</phase>-->
@@ -453,7 +474,6 @@
<plugin> <plugin>
<groupId>de.saumya.mojo</groupId> <groupId>de.saumya.mojo</groupId>
<artifactId>gem-maven-plugin</artifactId> <artifactId>gem-maven-plugin</artifactId>
<version>1.0.0-rc</version>
</plugin> </plugin>
<goal>exec</goal> <goal>exec</goal>
<configuration> <configuration>

19
pom.xml
View File

@@ -97,9 +97,23 @@
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-antrun-plugin</artifactId>
<version>2.4</version> <version>1.7</version>
</plugin> </plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin>
<plugin> <plugin>
<groupId>com.mycila</groupId> <groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId> <artifactId>license-maven-plugin</artifactId>
@@ -114,7 +128,6 @@
<!-- Ensure that any *.properties files have UTF-8 chars encoded (e.g. "\u00e9") *before* using them to filter dspace.cfg and other configs --> <!-- Ensure that any *.properties files have UTF-8 chars encoded (e.g. "\u00e9") *before* using them to filter dspace.cfg and other configs -->
<plugin> <plugin>
<artifactId>maven-antrun-plugin</artifactId> <artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions> <executions>
<execution> <execution>
<id>native2ascii-utf8</id> <id>native2ascii-utf8</id>