Opened 13 years ago

Closed 13 years ago

#531 closed task (fixed)

Build / use maven profiles and resources filter

Reported by: fxp Owned by: geonetwork-devel@…
Priority: minor Milestone: v2.7.0
Component: General Version:
Keywords: Cc: jesseeichar

Description

Add profile support in maven pom.xml in order to:

  • update properties (eg. version number, xsl factory) in different files (eg. config.xml, create-db-default.sql, server.prop)
  • easily create custom build (eg. INSPIRE one)

Usage :

  • mvn -Denv=dev
  • mvn -Denv=inspire
  • mvn -Denv=prod (default)

To do: apply to the installer build.xml and documentation ?

Attachments (2)

maven-profiles.patch (530.2 KB ) - added by fxp 13 years ago.
531_fix_for_jetty.patch (4.5 KB ) - added by jesseeichar 13 years ago.
A patch so that the jetty can still be used and war will work correctly. The strategy I used was essentially the same as I described in an earlier comment

Download all attachments as: .zip

Change History (7)

by fxp, 13 years ago

Attachment: maven-profiles.patch added

comment:1 by fxp, 13 years ago

Committed revision 8062.

comment:2 by jesseeichar, 13 years ago

Cc: jesseeichar added

This change breaks running jetty because the filters are only ran the war is being built. I am looking into updating the jetty configuration

comment:3 by jesseeichar, 13 years ago

One idea is to not do the filtering in the war configuration but instead:

  1. move files in webResources back to webapp
  2. do the filtering as part of resource processing phase which copies all the webapp files to a directory in target
  3. update pom so that the webapp resources for both jetty and war are found in the filtered directory.

I will try to do this and create a patch.

by jesseeichar, 13 years ago

Attachment: 531_fix_for_jetty.patch added

A patch so that the jetty can still be used and war will work correctly. The strategy I used was essentially the same as I described in an earlier comment

comment:4 by jesseeichar, 13 years ago

I found a problem with my patch. the line:

<directory>src/main/webResources</directory>

must be changed to

<directory>${basedir}/src/main/webResources</directory>

and

<filter>src/main/filters/${env}.properties</filter>

must be changed to

<filter>${basedir}/src/main/filters/${env}.properties</filter>

(after the previous patch has been applied)

And while applying previous patch you will probably have to apply it from web project as follows:

web> patch -p1 < 531_fix_for_jetty.patch

comment:5 by Fxp, 13 years ago

Resolution: fixed
Status: newclosed

Revision: 8074

Note: See TracTickets for help on using tickets.