maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark H. Wood" <mw...@IUPUI.Edu>
Subject Re: using build profiles for WAR plugin
Date Fri, 02 Mar 2012 14:54:50 GMT
On Thu, Mar 01, 2012 at 11:16:34AM -0800, offbyone wrote:
> Ok, I hear you, profiles are evil.  BUT I still don't understand the
> alternative so let me give a specific and tangible example and maybe you can
> explain a specific alternative.
> 
> I am currently deploying my product in a tomcat/linux environment as a war
> file.  My webapp is driven by a set of spring configuration files using the
> Spring context loader.  For example, one of those spring configuration files
> is called LookAndFeel.xml.  It sets attributes like colors of the user
> interface.  I love using this type of configuration driven design because it
> lets me swap out the entire look and feel just by changing a config file.
> 
> There are many deployments of my application on different systems and each
> one has a different look and feel configuration file.  So, I was planning to
> have a different maven profile for each deployment and have the profile
> automatically push the correct LookAndFeel.xml into the war archive.
> 
> So specifically how do I accomplish this this in maven without using
> profiles?  

Better you don't.

Should I assume that LookAndFeel.xml is something that you design for
the customer, rather than (as I first thought) something the customer
is supposed to customize on-site?  Then the problem is that you are
using Maven as a packaging tool.  That's not what it is; it's a build
tool.  Packaging is a different stage.

You could keep a copy of deployment X's LookAndFeel with your other
records for deployment X, or keep them all in one directory.  Yank
the custom values out of a database, or write a wizard to step someone
through the customization process, and create a LookAndFeel on the fly
with e.g. XSL-T when you are packaging your generic Maven-built
artifacts for deployment X.

The point is that customization is not part of the product; it's part
of the deployment.  Maven builds your product.  You need something
else for deployment.

-- 
Mark H. Wood, Lead System Programmer   mwood@IUPUI.Edu
When the only tool you have is a hammer, every problem looks like a nail.
  -- Maslow

Mime
View raw message