You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jean-Noël Colin <jn...@gmail.com> on 2013/02/25 20:41:20 UTC

dynamically select resources and apply filtering

Hi

I'm trying to migrate my project from ant to maven, but I'm facing a few difficulties; I need to build my project for different environments (customers, so possibly a long list). In my ant project, I had several .properties file, one per customer; in this file, I had properties used to customize some config file; I managed to use resource filtering to achieve this.

However, some properties defined a filename that needed to be copied to the war archive, but under a common name. For instance, I had several logos: logo_customer1.jpg, logo_customer2.jpg, logo_customer3.jpg; the source file name was specified in the properties file (customer1.properties, customer2.properties, customer3.properties), but the destination was always logo.jpg. How can I do that? 

Second, the properties file defines the name of the file (resources) to be filtered. For instance, I have a template for working with Spring Security in LDAP environment and another template when working when Active Directory; the customer properties file defined the name of the template to use, but in both cases, the result file needs to be applicationContext-security.xml. How can i achieve this? Or is there a way to define conditional profiles so that in the customer .properties file, I would say LDAP or AD, and based on that value, different profile would be used? 

Many thanks for your help

Jean-Noël


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: dynamically select resources and apply filtering

Posted by Jean-Noël Colin <jn...@gmail.com>.
Hi

THanks for your suggestion, but I don't think it will work; for instance, I have to customize some springsecurity files that have to be included in the war file; those files are instantiated from templates that differ from environment to environment (LDAP, AD...); also, I don't want to copy all different logos to the war file, while only one should be used. 

I'm using jndi for db parameters for instance. 

basically, my process is: 
update code
for each environment (customer)
customize package
deploy package

so I can't think of an easy way to extract the configuration, and build the package only once. 

Best regards

Jean-Noël


On 25 Feb 2013, at 21:42, Adrien Rivard <ad...@gmail.com> wrote:

> On Mon, Feb 25, 2013 at 8:41 PM, Jean-Noël Colin <jn...@gmail.com> wrote:
> 
>> Hi
>> 
>> I'm trying to migrate my project from ant to maven, but I'm facing a few
>> difficulties; I need to build my project for different environments
>> (customers, so possibly a long list). In my ant project, I had several
>> .properties file, one per customer; in this file, I had properties used to
>> customize some config file; I managed to use resource filtering to achieve
>> this.
>> 
>> 
> The best way to handle this is to externalize your configuration.This way,
> you build one time one war that never changed, and you deploy this one
> along with the configuration file.
> Since you already have properties you should just externalize them (spring
> placeholder ..). Another option would be to use JNDI (more flexible but
> also more complicated IMO)
> 
> The second option is to multiple the number of project (1 master and a lots
> of nearly empty one for each customers.), but this work only if you know
> the configuration at build time.
> 
> The Thing to not do is to build one project multiple times, but each time
> different. (Basic maven rule : One project -> one artifact)
> 
> 
>> However, some properties defined a filename that needed to be copied to
>> the war archive, but under a common name. For instance, I had several
>> logos: logo_customer1.jpg, logo_customer2.jpg, logo_customer3.jpg; the
>> source file name was specified in the properties file
>> (customer1.properties, customer2.properties, customer3.properties), but the
>> destination was always logo.jpg. How can I do that?
>> 
>> On a webapp, I usually read it through a Servlet that read the path
> configured in the properties.
> 
> 
> 
>> Second, the properties file defines the name of the file (resources) to be
>> filtered. For instance, I have a template for working with Spring Security
>> in LDAP environment and another template when working when Active
>> Directory; the customer properties file defined the name of the template to
>> use, but in both cases, the result file needs to be
>> applicationContext-security.xml. How can i achieve this? Or is there a way
>> to define conditional profiles so that in the customer .properties file, I
>> would say LDAP or AD, and based on that value, different profile would be
>> used?
>> 
> 
> Spring can perfectly handle multiple authentication Manager, if only one is
> configured, one will failed, the other will work.
> 
> 
>> 
>> Many thanks for your help
>> 
>> Jean-Noël
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 
> 
> 
> -- 
> Adrien Rivard


Re: dynamically select resources and apply filtering

Posted by Adrien Rivard <ad...@gmail.com>.
On Mon, Feb 25, 2013 at 8:41 PM, Jean-Noël Colin <jn...@gmail.com> wrote:

> Hi
>
> I'm trying to migrate my project from ant to maven, but I'm facing a few
> difficulties; I need to build my project for different environments
> (customers, so possibly a long list). In my ant project, I had several
> .properties file, one per customer; in this file, I had properties used to
> customize some config file; I managed to use resource filtering to achieve
> this.
>
>
The best way to handle this is to externalize your configuration.This way,
you build one time one war that never changed, and you deploy this one
along with the configuration file.
Since you already have properties you should just externalize them (spring
placeholder ..). Another option would be to use JNDI (more flexible but
also more complicated IMO)

The second option is to multiple the number of project (1 master and a lots
of nearly empty one for each customers.), but this work only if you know
the configuration at build time.

The Thing to not do is to build one project multiple times, but each time
different. (Basic maven rule : One project -> one artifact)


> However, some properties defined a filename that needed to be copied to
> the war archive, but under a common name. For instance, I had several
> logos: logo_customer1.jpg, logo_customer2.jpg, logo_customer3.jpg; the
> source file name was specified in the properties file
> (customer1.properties, customer2.properties, customer3.properties), but the
> destination was always logo.jpg. How can I do that?
>
> On a webapp, I usually read it through a Servlet that read the path
configured in the properties.



> Second, the properties file defines the name of the file (resources) to be
> filtered. For instance, I have a template for working with Spring Security
> in LDAP environment and another template when working when Active
> Directory; the customer properties file defined the name of the template to
> use, but in both cases, the result file needs to be
> applicationContext-security.xml. How can i achieve this? Or is there a way
> to define conditional profiles so that in the customer .properties file, I
> would say LDAP or AD, and based on that value, different profile would be
> used?
>

Spring can perfectly handle multiple authentication Manager, if only one is
configured, one will failed, the other will work.


>
> Many thanks for your help
>
> Jean-Noël
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Adrien Rivard

Re: dynamically select resources and apply filtering

Posted by Jean-Noël Colin <jn...@gmail.com>.
this sounds easy :-) any CM tool to recommend? 

many thanks

On 26 Feb 2013, at 16:22, Wayne Fay <wa...@gmail.com> wrote:

>> again, many thanks for your valuable comments; but my issue is
>> that if Maven packages the war file, it means that the config files
>> have already been customized (think of the spring config files in
>> WEB-INF for instance); so how can I mix both approaches?
> 
> Here's two solutions I can imagine:
> 1. externalize all configuration, so the Spring config files in
> WEB-INF do not even exist in what Maven is building, but rather you
> have one or more configuration projects (client/env-specific) and then
> your CM tool merges the Maven-built WAR with one or more of those
> config jars
> 2. internalize all configuration, so all configurations across all
> clients/envs are included in one single WAR, and then your CM tool
> simply cuts out everything EXCEPT the one set of files required for
> the client/env you are building
> 
> Wayne
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: dynamically select resources and apply filtering

Posted by Wayne Fay <wa...@gmail.com>.
> again, many thanks for your valuable comments; but my issue is
> that if Maven packages the war file, it means that the config files
> have already been customized (think of the spring config files in
> WEB-INF for instance); so how can I mix both approaches?

Here's two solutions I can imagine:
1. externalize all configuration, so the Spring config files in
WEB-INF do not even exist in what Maven is building, but rather you
have one or more configuration projects (client/env-specific) and then
your CM tool merges the Maven-built WAR with one or more of those
config jars
2. internalize all configuration, so all configurations across all
clients/envs are included in one single WAR, and then your CM tool
simply cuts out everything EXCEPT the one set of files required for
the client/env you are building

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: dynamically select resources and apply filtering

Posted by Jean-Noël Colin <jn...@gmail.com>.
again, many thanks for your valuable comments; but my issue is that if Maven packages the war file, it means that the config files have already been customized (think of the spring config files in WEB-INF for instance); so how can I mix both approaches?

Cheers

Jean-Noël

On 26 Feb 2013, at 16:14, Wayne Fay <wa...@gmail.com> wrote:

> I don't want to speak for Ron, but I'll fill in my interpretation of
> his comments...
> 
>> so your suggestion would be to have maven do the compile, and a kind
>> of 'war:exploded', and then run ant to add the customized files and create
>> the war file, is that correct?
> 
> Not at all. I believe he is saying, use Maven for what it does best
> all the way up to the deploy phase. Then invent some other tooling to
> download these files from your MRM and customize them for the various
> clients and environments. The results of that customization may end up
> in your MRM (under a client/environment-specific artifactId, perhaps)
> or simply being installed directly into the various servers they will
> run on.
> 
> 
>> or should I write a plugin that does that for me?
> 
> Well, you'll need to write "something" but not necessarily a Maven
> plugin because this will be running outside of your normal Maven build
> process. It could be in Ant or any other language/tooling.
> 
> 
>> then, what should I use to customise and deploy distribution kits?
> 
> This is undefined from Maven's point of view. Maven helps you build
> the code. What you are talking about is Configuration Management which
> is not one of Maven's core concerns.
> 
> Wayne
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: dynamically select resources and apply filtering

Posted by Wayne Fay <wa...@gmail.com>.
I don't want to speak for Ron, but I'll fill in my interpretation of
his comments...

> so your suggestion would be to have maven do the compile, and a kind
> of 'war:exploded', and then run ant to add the customized files and create
> the war file, is that correct?

Not at all. I believe he is saying, use Maven for what it does best
all the way up to the deploy phase. Then invent some other tooling to
download these files from your MRM and customize them for the various
clients and environments. The results of that customization may end up
in your MRM (under a client/environment-specific artifactId, perhaps)
or simply being installed directly into the various servers they will
run on.


> or should I write a plugin that does that for me?

Well, you'll need to write "something" but not necessarily a Maven
plugin because this will be running outside of your normal Maven build
process. It could be in Ant or any other language/tooling.


> then, what should I use to customise and deploy distribution kits?

This is undefined from Maven's point of view. Maven helps you build
the code. What you are talking about is Configuration Management which
is not one of Maven's core concerns.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: dynamically select resources and apply filtering

Posted by Jean-Noël Colin <jn...@gmail.com>.
many thanks for this very useful reference

/jnc

On 26 Feb 2013, at 16:43, Stephen Connolly <st...@gmail.com> wrote:

> I have an answer on Stack Overflow that might help your thought processes:
> http://stackoverflow.com/questions/14650468/whats-a-practicable-way-for-automated-configuration-versioning-and-deployment/14661186#14661186
> 
> 
> On 26 February 2013 15:06, Jean-Noël Colin <jn...@gmail.com> wrote:
> 
>> so your suggestion would be to have maven do the compile, and a kind of
>> 'war:exploded', and then run ant to add the customized files and create the
>> war file, is that correct?
>> 
>> or should I write a plugin that does that for me?
>> 
>> You write: "Separating run-time deployment from Maven is a best practice";
>> but then, what should I use to customise and deploy distribution kits?
>> 
>> Best
>> 
>> Jean-Noël
>> 
>> On 26 Feb 2013, at 10:01, Ron Wheeler <rw...@artifact-software.com>
>> wrote:
>> 
>>> On 26/02/2013 2:54 AM, Baptiste MATHUS wrote:
>>>> I *think* Ron means: using maven to produce your standard artifacts
>>>> (jar/war/ear ?), and then use pure ant somewhere in the process just
>> before
>>>> deploying for a specific customer to do the replacements you're talking
>>>> about.
>>>> 
>>>> (By the way, invoking ant from maven (using antrun-maven-plugin) should
>>>> always be considered something bad and temporary. Writing or using a
>>>> dedicated maven plugin is the way to go).
>>>> 
>>> Exactly.
>>> My suggestion would be to run the ant after all the maven work is
>> complete and you have a full set of release files in your repo
>>> Have Ant (or some other process) merge the released code with
>> configuration files, logos, etc to make distribution kits.
>>> 
>>> Ron
>>>> 2013/2/26 Jean-Noël Colin <jn...@gmail.com>
>>>> 
>>>>> Hi Ron,
>>>>> 
>>>>> Do you mean invoking the ant plugin from the pom.xml file? I was
>> wondering
>>>>> whether this was a good practice, or something to be kept only for
>>>>> situations where you really can't avoid it
>>>>> 
>>>>> Best regards
>>>>> 
>>>>> Jean-Noël
>>>>> 
>>>>> On 25 Feb 2013, at 21:31, Ron Wheeler <rw...@artifact-software.com>
>>>>> wrote:
>>>>> 
>>>>>> Why not move the production of the software to Maven and leave the
>>>>> assembly in Ant.
>>>>>> That would give you the best of both worlds.
>>>>>> 
>>>>>> 
>>>>>> On 25/02/2013 2:41 PM, Jean-Noël Colin wrote:
>>>>>>> Hi
>>>>>>> 
>>>>>>> I'm trying to migrate my project from ant to maven, but I'm facing a
>>>>> few difficulties; I need to build my project for different environments
>>>>> (customers, so possibly a long list). In my ant project, I had several
>>>>> .properties file, one per customer; in this file, I had properties
>> used to
>>>>> customize some config file; I managed to use resource filtering to
>> achieve
>>>>> this.
>>>>>>> However, some properties defined a filename that needed to be copied
>> to
>>>>> the war archive, but under a common name. For instance, I had several
>>>>> logos: logo_customer1.jpg, logo_customer2.jpg, logo_customer3.jpg; the
>>>>> source file name was specified in the properties file
>>>>> (customer1.properties, customer2.properties, customer3.properties),
>> but the
>>>>> destination was always logo.jpg. How can I do that?
>>>>>>> Second, the properties file defines the name of the file (resources)
>> to
>>>>> be filtered. For instance, I have a template for working with Spring
>>>>> Security in LDAP environment and another template when working when
>> Active
>>>>> Directory; the customer properties file defined the name of the
>> template to
>>>>> use, but in both cases, the result file needs to be
>>>>> applicationContext-security.xml. How can i achieve this? Or is there a
>> way
>>>>> to define conditional profiles so that in the customer .properties
>> file, I
>>>>> would say LDAP or AD, and based on that value, different profile would
>> be
>>>>> used?
>>>>>>> Many thanks for your help
>>>>>>> 
>>>>>>> Jean-Noël
>>>>>>> 
>>>>>>> 
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> Ron Wheeler
>>>>>> President
>>>>>> Artifact Software Inc
>>>>>> email: rwheeler@artifact-software.com
>>>>>> skype: ronaldmwheeler
>>>>>> phone: 866-970-2435, ext 102
>>>>>> 
>>>>>> 
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>> 
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>> 
>>>>> --
>>>>> Baptiste <Batmat> MATHUS - http://batmat.net
>>>>> Sauvez un arbre,
>>>>> Mangez un castor ! nbsp;! <us...@maven.apache.org>
>>>>> 
>>> 
>>> 
>>> --
>>> Ron Wheeler
>>> President
>>> Artifact Software Inc
>>> email: rwheeler@artifact-software.com
>>> skype: ronaldmwheeler
>>> phone: 866-970-2435, ext 102
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: dynamically select resources and apply filtering

Posted by Jean-Noël Colin <jn...@gmail.com>.
Stephen, 

Many thanks for taking the time to write this long and valuable response; I'll follow your advise, and work sprint by sprint in trying to get into the maven way. 

Best regards

Jean-Noël

On 27 Feb 2013, at 10:25, Stephen Connolly <st...@gmail.com> wrote:

> Yes, though better is to have the customizations in a separate file and
> then the war picks up that file and applied the customizations to itself,
> thus removing the need to customize a war at all.
> 
> For example, you could package up the customizations in a .jar file with a
> customization descriptor at a defined classpath url (e.g.
> /META-INF/com.mydomain.myapp/customizations.toml )
> 
> the customizations descriptor could be as simple as a .properties file that
> names the resources, or as complex as an XML/yaml descriptor that does all
> sorts of fancy mapping... a servlet filter could intercept requests for
> static resources and serve them from the customized resource location, and
> some other tweaks to your .war's logic, can filter in the modifications to
> dynamic pages.
> 
> You then just drop the customizations.jar into the Tomcat shared lib folder
> and now you just drop the standard war into any customers tomcat and you
> don't have to worry, no repacking at all... it will just pick up their
> customizations automagically
> 
> If you like, the above is much more the "Maven way" of solving your
> problem... granted right now you may not be able to move to that goal right
> now, for one it will involve refactoring your current code... so when faced
> with that kind of problem I would say
> 
> "OK, I know the end goal, it sounds attractive as it removes a pain point
> for me (namely having to run the customize step for each customer) and it
> also removes a potential problem (namely forgetting to customize and
> deploying an uncustomized .war into a customers instance), but right now
> there are too many moving pieces, so I will use the stop-gap of using
> ANT/Chef/Puppet/Gradle/BASH/whatever to unpack, customize and repack the
> .war for each customer. Next sprint we will start moving towards the ideal
> customizations architecture"
> 
> The repack solution is outside of Maven's responsibilities, so it doesn't
> care whether you do a repack or a customizations.jar... the point is that
> once you grok the Maven way, you will care, and you will find yourself
> wanting to do this the "right"* way...
> 
> If I have 3-5 customers, I'd probably stick with the repack... more than 5
> and I'd push for the customizations.jar model
> 
> -Stephen
> 
> * There is no "right" way, but we can apply Occam's software release
> management razor: among competing release processes, the one that uses the
> fewest manual steps should be selected.
> 
> 
> On 27 February 2013 08:56, Jean-Noël Colin <jn...@gmail.com> wrote:
> 
>> so basically, what you recommend is to use Maven to build a 'standard'
>> war, and then write my own scripts to customize the war to each distinct
>> environment, is that right?
>> 
>> Jean-Noël
>> 
>> On 26 Feb 2013, at 17:50, Ron Wheeler <rw...@artifact-software.com>
>> wrote:
>> 
>>> Since you want to support a "lot" of customers with different
>> configurations, you may want something that is based on a simple CMS that
>> provides a database and an editing tool and an API for extracting content.
>>> You script could then navigate the CMS picking up the right pieces to
>> make up the war for each client.
>>> 
>>> If you have to deliver updated documentation, release note and revised
>> EULAs, then you might want to use your script to prepare an installer
>> staging area and invoke an installer build package to build a customized
>> installer for each client.
>>> 
>>> 
>>> Ron
>>> 
>>> On 26/02/2013 10:49 AM, Lyons, Roy wrote:
>>>> I say that you could just run a post-deployment command that performs
>> any
>>>> filtering.  You could use ant, perl, java, whatever you wanted to...
>> and
>>>> perhaps have it pull down content from a centralized git repository or
>>>> something to make it easy to maintain your properties/configs.
>>>> 
>>>> The obvious mess comes into play if you are performing deployments using
>>>> the maven tomcat plugin or something similar instead of a real packaging
>>>> tool.
>>>> 
>>>> 
>>>> Thanks,
>>>> 
>>>> Roy Lyons
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> On 2/26/13 9:43 AM, "Stephen Connolly" <stephen.alan.connolly@gmail.com
>>> 
>>>> wrote:
>>>> 
>>>>> I have an answer on Stack Overflow that might help your thought
>> processes:
>>>>> 
>> http://stackoverflow.com/questions/14650468/whats-a-practicable-way-for-au
>>>>> tomated-configuration-versioning-and-deployment/14661186#14661186
>>>>> 
>>>>> 
>>>>> On 26 February 2013 15:06, Jean-Noël Colin <jn...@gmail.com> wrote:
>>>>> 
>>>>>> so your suggestion would be to have maven do the compile, and a kind
>> of
>>>>>> 'war:exploded', and then run ant to add the customized files and
>> create
>>>>>> the
>>>>>> war file, is that correct?
>>>>>> 
>>>>>> or should I write a plugin that does that for me?
>>>>>> 
>>>>>> You write: "Separating run-time deployment from Maven is a best
>>>>>> practice";
>>>>>> but then, what should I use to customise and deploy distribution kits?
>>>>>> 
>>>>>> Best
>>>>>> 
>>>>>> Jean-Noël
>>>>>> 
>>>>>> On 26 Feb 2013, at 10:01, Ron Wheeler <rwheeler@artifact-software.com
>>> 
>>>>>> wrote:
>>>>>> 
>>>>>>> On 26/02/2013 2:54 AM, Baptiste MATHUS wrote:
>>>>>>>> I *think* Ron means: using maven to produce your standard artifacts
>>>>>>>> (jar/war/ear ?), and then use pure ant somewhere in the process just
>>>>>> before
>>>>>>>> deploying for a specific customer to do the replacements you're
>>>>>> talking
>>>>>>>> about.
>>>>>>>> 
>>>>>>>> (By the way, invoking ant from maven (using antrun-maven-plugin)
>>>>>> should
>>>>>>>> always be considered something bad and temporary. Writing or using a
>>>>>>>> dedicated maven plugin is the way to go).
>>>>>>>> 
>>>>>>> Exactly.
>>>>>>> My suggestion would be to run the ant after all the maven work is
>>>>>> complete and you have a full set of release files in your repo
>>>>>>> Have Ant (or some other process) merge the released code with
>>>>>> configuration files, logos, etc to make distribution kits.
>>>>>>> Ron
>>>>>>>> 2013/2/26 Jean-Noël Colin <jn...@gmail.com>
>>>>>>>> 
>>>>>>>>> Hi Ron,
>>>>>>>>> 
>>>>>>>>> Do you mean invoking the ant plugin from the pom.xml file? I was
>>>>>> wondering
>>>>>>>>> whether this was a good practice, or something to be kept only for
>>>>>>>>> situations where you really can't avoid it
>>>>>>>>> 
>>>>>>>>> Best regards
>>>>>>>>> 
>>>>>>>>> Jean-Noël
>>>>>>>>> 
>>>>>>>>> On 25 Feb 2013, at 21:31, Ron Wheeler
>>>>>> <rw...@artifact-software.com>
>>>>>>>>> wrote:
>>>>>>>>> 
>>>>>>>>>> Why not move the production of the software to Maven and leave the
>>>>>>>>> assembly in Ant.
>>>>>>>>>> That would give you the best of both worlds.
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> On 25/02/2013 2:41 PM, Jean-Noël Colin wrote:
>>>>>>>>>>> Hi
>>>>>>>>>>> 
>>>>>>>>>>> I'm trying to migrate my project from ant to maven, but I'm
>>>>>> facing a
>>>>>>>>> few difficulties; I need to build my project for different
>>>>>> environments
>>>>>>>>> (customers, so possibly a long list). In my ant project, I had
>>>>>> several
>>>>>>>>> .properties file, one per customer; in this file, I had properties
>>>>>> used to
>>>>>>>>> customize some config file; I managed to use resource filtering to
>>>>>> achieve
>>>>>>>>> this.
>>>>>>>>>>> However, some properties defined a filename that needed to be
>>>>>> copied
>>>>>> to
>>>>>>>>> the war archive, but under a common name. For instance, I had
>>>>>> several
>>>>>>>>> logos: logo_customer1.jpg, logo_customer2.jpg, logo_customer3.jpg;
>>>>>> the
>>>>>>>>> source file name was specified in the properties file
>>>>>>>>> (customer1.properties, customer2.properties, customer3.properties),
>>>>>> but the
>>>>>>>>> destination was always logo.jpg. How can I do that?
>>>>>>>>>>> Second, the properties file defines the name of the file
>>>>>> (resources)
>>>>>> to
>>>>>>>>> be filtered. For instance, I have a template for working with
>> Spring
>>>>>>>>> Security in LDAP environment and another template when working when
>>>>>> Active
>>>>>>>>> Directory; the customer properties file defined the name of the
>>>>>> template to
>>>>>>>>> use, but in both cases, the result file needs to be
>>>>>>>>> applicationContext-security.xml. How can i achieve this? Or is
>>>>>> there a
>>>>>> way
>>>>>>>>> to define conditional profiles so that in the customer .properties
>>>>>> file, I
>>>>>>>>> would say LDAP or AD, and based on that value, different profile
>>>>>> would
>>>>>> be
>>>>>>>>> used?
>>>>>>>>>>> Many thanks for your help
>>>>>>>>>>> 
>>>>>>>>>>> Jean-Noël
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>> --
>>>>>>>>>> Ron Wheeler
>>>>>>>>>> President
>>>>>>>>>> Artifact Software Inc
>>>>>>>>>> email: rwheeler@artifact-software.com
>>>>>>>>>> skype: ronaldmwheeler
>>>>>>>>>> phone: 866-970-2435, ext 102
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>> ---------------------------------------------------------------------
>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>>>>> 
>>>>>>>>> 
>>>>>> ---------------------------------------------------------------------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>>>> 
>>>>>>>>> --
>>>>>>>>> Baptiste <Batmat> MATHUS - http://batmat.net
>>>>>>>>> Sauvez un arbre,
>>>>>>>>> Mangez un castor ! nbsp;! <us...@maven.apache.org>
>>>>>>>>> 
>>>>>>> 
>>>>>>> --
>>>>>>> Ron Wheeler
>>>>>>> President
>>>>>>> Artifact Software Inc
>>>>>>> email: rwheeler@artifact-software.com
>>>>>>> skype: ronaldmwheeler
>>>>>>> phone: 866-970-2435, ext 102
>>>>>>> 
>>>>>>> 
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>> 
>>>>>> 
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>> 
>>>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>> 
>>>> 
>>> 
>>> 
>>> --
>>> Ron Wheeler
>>> President
>>> Artifact Software Inc
>>> email: rwheeler@artifact-software.com
>>> skype: ronaldmwheeler
>>> phone: 866-970-2435, ext 102
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: dynamically select resources and apply filtering

Posted by Stephen Connolly <st...@gmail.com>.
Yes, though better is to have the customizations in a separate file and
then the war picks up that file and applied the customizations to itself,
thus removing the need to customize a war at all.

For example, you could package up the customizations in a .jar file with a
customization descriptor at a defined classpath url (e.g.
/META-INF/com.mydomain.myapp/customizations.toml )

the customizations descriptor could be as simple as a .properties file that
names the resources, or as complex as an XML/yaml descriptor that does all
sorts of fancy mapping... a servlet filter could intercept requests for
static resources and serve them from the customized resource location, and
some other tweaks to your .war's logic, can filter in the modifications to
dynamic pages.

You then just drop the customizations.jar into the Tomcat shared lib folder
and now you just drop the standard war into any customers tomcat and you
don't have to worry, no repacking at all... it will just pick up their
customizations automagically

If you like, the above is much more the "Maven way" of solving your
problem... granted right now you may not be able to move to that goal right
now, for one it will involve refactoring your current code... so when faced
with that kind of problem I would say

"OK, I know the end goal, it sounds attractive as it removes a pain point
for me (namely having to run the customize step for each customer) and it
also removes a potential problem (namely forgetting to customize and
deploying an uncustomized .war into a customers instance), but right now
there are too many moving pieces, so I will use the stop-gap of using
ANT/Chef/Puppet/Gradle/BASH/whatever to unpack, customize and repack the
.war for each customer. Next sprint we will start moving towards the ideal
customizations architecture"

The repack solution is outside of Maven's responsibilities, so it doesn't
care whether you do a repack or a customizations.jar... the point is that
once you grok the Maven way, you will care, and you will find yourself
wanting to do this the "right"* way...

If I have 3-5 customers, I'd probably stick with the repack... more than 5
and I'd push for the customizations.jar model

-Stephen

* There is no "right" way, but we can apply Occam's software release
management razor: among competing release processes, the one that uses the
fewest manual steps should be selected.


On 27 February 2013 08:56, Jean-Noël Colin <jn...@gmail.com> wrote:

> so basically, what you recommend is to use Maven to build a 'standard'
> war, and then write my own scripts to customize the war to each distinct
> environment, is that right?
>
> Jean-Noël
>
> On 26 Feb 2013, at 17:50, Ron Wheeler <rw...@artifact-software.com>
> wrote:
>
> > Since you want to support a "lot" of customers with different
> configurations, you may want something that is based on a simple CMS that
> provides a database and an editing tool and an API for extracting content.
> > You script could then navigate the CMS picking up the right pieces to
> make up the war for each client.
> >
> > If you have to deliver updated documentation, release note and revised
> EULAs, then you might want to use your script to prepare an installer
> staging area and invoke an installer build package to build a customized
> installer for each client.
> >
> >
> > Ron
> >
> > On 26/02/2013 10:49 AM, Lyons, Roy wrote:
> >> I say that you could just run a post-deployment command that performs
> any
> >> filtering.  You could use ant, perl, java, whatever you wanted to...
>  and
> >> perhaps have it pull down content from a centralized git repository or
> >> something to make it easy to maintain your properties/configs.
> >>
> >> The obvious mess comes into play if you are performing deployments using
> >> the maven tomcat plugin or something similar instead of a real packaging
> >> tool.
> >>
> >>
> >> Thanks,
> >>
> >> Roy Lyons
> >>
> >>
> >>
> >>
> >>
> >> On 2/26/13 9:43 AM, "Stephen Connolly" <stephen.alan.connolly@gmail.com
> >
> >> wrote:
> >>
> >>> I have an answer on Stack Overflow that might help your thought
> processes:
> >>>
> http://stackoverflow.com/questions/14650468/whats-a-practicable-way-for-au
> >>> tomated-configuration-versioning-and-deployment/14661186#14661186
> >>>
> >>>
> >>> On 26 February 2013 15:06, Jean-Noël Colin <jn...@gmail.com> wrote:
> >>>
> >>>> so your suggestion would be to have maven do the compile, and a kind
> of
> >>>> 'war:exploded', and then run ant to add the customized files and
> create
> >>>> the
> >>>> war file, is that correct?
> >>>>
> >>>> or should I write a plugin that does that for me?
> >>>>
> >>>> You write: "Separating run-time deployment from Maven is a best
> >>>> practice";
> >>>> but then, what should I use to customise and deploy distribution kits?
> >>>>
> >>>> Best
> >>>>
> >>>> Jean-Noël
> >>>>
> >>>> On 26 Feb 2013, at 10:01, Ron Wheeler <rwheeler@artifact-software.com
> >
> >>>> wrote:
> >>>>
> >>>>> On 26/02/2013 2:54 AM, Baptiste MATHUS wrote:
> >>>>>> I *think* Ron means: using maven to produce your standard artifacts
> >>>>>> (jar/war/ear ?), and then use pure ant somewhere in the process just
> >>>> before
> >>>>>> deploying for a specific customer to do the replacements you're
> >>>> talking
> >>>>>> about.
> >>>>>>
> >>>>>> (By the way, invoking ant from maven (using antrun-maven-plugin)
> >>>> should
> >>>>>> always be considered something bad and temporary. Writing or using a
> >>>>>> dedicated maven plugin is the way to go).
> >>>>>>
> >>>>> Exactly.
> >>>>> My suggestion would be to run the ant after all the maven work is
> >>>> complete and you have a full set of release files in your repo
> >>>>> Have Ant (or some other process) merge the released code with
> >>>> configuration files, logos, etc to make distribution kits.
> >>>>> Ron
> >>>>>> 2013/2/26 Jean-Noël Colin <jn...@gmail.com>
> >>>>>>
> >>>>>>> Hi Ron,
> >>>>>>>
> >>>>>>> Do you mean invoking the ant plugin from the pom.xml file? I was
> >>>> wondering
> >>>>>>> whether this was a good practice, or something to be kept only for
> >>>>>>> situations where you really can't avoid it
> >>>>>>>
> >>>>>>> Best regards
> >>>>>>>
> >>>>>>> Jean-Noël
> >>>>>>>
> >>>>>>> On 25 Feb 2013, at 21:31, Ron Wheeler
> >>>> <rw...@artifact-software.com>
> >>>>>>> wrote:
> >>>>>>>
> >>>>>>>> Why not move the production of the software to Maven and leave the
> >>>>>>> assembly in Ant.
> >>>>>>>> That would give you the best of both worlds.
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> On 25/02/2013 2:41 PM, Jean-Noël Colin wrote:
> >>>>>>>>> Hi
> >>>>>>>>>
> >>>>>>>>> I'm trying to migrate my project from ant to maven, but I'm
> >>>> facing a
> >>>>>>> few difficulties; I need to build my project for different
> >>>> environments
> >>>>>>> (customers, so possibly a long list). In my ant project, I had
> >>>> several
> >>>>>>> .properties file, one per customer; in this file, I had properties
> >>>> used to
> >>>>>>> customize some config file; I managed to use resource filtering to
> >>>> achieve
> >>>>>>> this.
> >>>>>>>>> However, some properties defined a filename that needed to be
> >>>> copied
> >>>> to
> >>>>>>> the war archive, but under a common name. For instance, I had
> >>>> several
> >>>>>>> logos: logo_customer1.jpg, logo_customer2.jpg, logo_customer3.jpg;
> >>>> the
> >>>>>>> source file name was specified in the properties file
> >>>>>>> (customer1.properties, customer2.properties, customer3.properties),
> >>>> but the
> >>>>>>> destination was always logo.jpg. How can I do that?
> >>>>>>>>> Second, the properties file defines the name of the file
> >>>> (resources)
> >>>> to
> >>>>>>> be filtered. For instance, I have a template for working with
> Spring
> >>>>>>> Security in LDAP environment and another template when working when
> >>>> Active
> >>>>>>> Directory; the customer properties file defined the name of the
> >>>> template to
> >>>>>>> use, but in both cases, the result file needs to be
> >>>>>>> applicationContext-security.xml. How can i achieve this? Or is
> >>>> there a
> >>>> way
> >>>>>>> to define conditional profiles so that in the customer .properties
> >>>> file, I
> >>>>>>> would say LDAP or AD, and based on that value, different profile
> >>>> would
> >>>> be
> >>>>>>> used?
> >>>>>>>>> Many thanks for your help
> >>>>>>>>>
> >>>>>>>>> Jean-Noël
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>> ---------------------------------------------------------------------
> >>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>> --
> >>>>>>>> Ron Wheeler
> >>>>>>>> President
> >>>>>>>> Artifact Software Inc
> >>>>>>>> email: rwheeler@artifact-software.com
> >>>>>>>> skype: ronaldmwheeler
> >>>>>>>> phone: 866-970-2435, ext 102
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>> ---------------------------------------------------------------------
> >>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>>>>>
> >>>>>>>
> >>>> ---------------------------------------------------------------------
> >>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>>>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>>>>
> >>>>>>> --
> >>>>>>> Baptiste <Batmat> MATHUS - http://batmat.net
> >>>>>>> Sauvez un arbre,
> >>>>>>> Mangez un castor ! nbsp;! <us...@maven.apache.org>
> >>>>>>>
> >>>>>
> >>>>> --
> >>>>> Ron Wheeler
> >>>>> President
> >>>>> Artifact Software Inc
> >>>>> email: rwheeler@artifact-software.com
> >>>>> skype: ronaldmwheeler
> >>>>> phone: 866-970-2435, ext 102
> >>>>>
> >>>>>
> >>>>> ---------------------------------------------------------------------
> >>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>
> >>>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
> >
> > --
> > Ron Wheeler
> > President
> > Artifact Software Inc
> > email: rwheeler@artifact-software.com
> > skype: ronaldmwheeler
> > phone: 866-970-2435, ext 102
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: dynamically select resources and apply filtering

Posted by Patrick Turcotte <pt...@rlnx.com>.
Not sure if it meets all of your criteria, but did you take a look at 
war overlays? ( 
http://maven.apache.org/plugins/maven-war-plugin/examples/war-overlay.html)

You could have your main project as a war file, and each client would 
get his own overlay project.

Patrick

On 13-02-27 03:56 AM, Jean-Noël Colin wrote:
> so basically, what you recommend is to use Maven to build a 'standard' war, and then write my own scripts to customize the war to each distinct environment, is that right?
>
> Jean-Noël
>
> On 26 Feb 2013, at 17:50, Ron Wheeler <rw...@artifact-software.com> wrote:
>
>> Since you want to support a "lot" of customers with different configurations, you may want something that is based on a simple CMS that provides a database and an editing tool and an API for extracting content.
>> You script could then navigate the CMS picking up the right pieces to make up the war for each client.
>>
>> If you have to deliver updated documentation, release note and revised EULAs, then you might want to use your script to prepare an installer staging area and invoke an installer build package to build a customized installer for each client.
>>
>>
>> Ron
>>
>> On 26/02/2013 10:49 AM, Lyons, Roy wrote:
>>> I say that you could just run a post-deployment command that performs any
>>> filtering.  You could use ant, perl, java, whatever you wanted to...  and
>>> perhaps have it pull down content from a centralized git repository or
>>> something to make it easy to maintain your properties/configs.
>>>
>>> The obvious mess comes into play if you are performing deployments using
>>> the maven tomcat plugin or something similar instead of a real packaging
>>> tool.
>>>
>>>
>>> Thanks,
>>>
>>> Roy Lyons
>>>
>>>
>>>
>>>
>>>
>>> On 2/26/13 9:43 AM, "Stephen Connolly" <st...@gmail.com>
>>> wrote:
>>>
>>>> I have an answer on Stack Overflow that might help your thought processes:
>>>> http://stackoverflow.com/questions/14650468/whats-a-practicable-way-for-au
>>>> tomated-configuration-versioning-and-deployment/14661186#14661186
>>>>
>>>>
>>>> On 26 February 2013 15:06, Jean-Noël Colin <jn...@gmail.com> wrote:
>>>>
>>>>> so your suggestion would be to have maven do the compile, and a kind of
>>>>> 'war:exploded', and then run ant to add the customized files and create
>>>>> the
>>>>> war file, is that correct?
>>>>>
>>>>> or should I write a plugin that does that for me?
>>>>>
>>>>> You write: "Separating run-time deployment from Maven is a best
>>>>> practice";
>>>>> but then, what should I use to customise and deploy distribution kits?
>>>>>
>>>>> Best
>>>>>
>>>>> Jean-Noël
>>>>>
>>>>> On 26 Feb 2013, at 10:01, Ron Wheeler <rw...@artifact-software.com>
>>>>> wrote:
>>>>>
>>>>>> On 26/02/2013 2:54 AM, Baptiste MATHUS wrote:
>>>>>>> I *think* Ron means: using maven to produce your standard artifacts
>>>>>>> (jar/war/ear ?), and then use pure ant somewhere in the process just
>>>>> before
>>>>>>> deploying for a specific customer to do the replacements you're
>>>>> talking
>>>>>>> about.
>>>>>>>
>>>>>>> (By the way, invoking ant from maven (using antrun-maven-plugin)
>>>>> should
>>>>>>> always be considered something bad and temporary. Writing or using a
>>>>>>> dedicated maven plugin is the way to go).
>>>>>>>
>>>>>> Exactly.
>>>>>> My suggestion would be to run the ant after all the maven work is
>>>>> complete and you have a full set of release files in your repo
>>>>>> Have Ant (or some other process) merge the released code with
>>>>> configuration files, logos, etc to make distribution kits.
>>>>>> Ron
>>>>>>> 2013/2/26 Jean-Noël Colin <jn...@gmail.com>
>>>>>>>
>>>>>>>> Hi Ron,
>>>>>>>>
>>>>>>>> Do you mean invoking the ant plugin from the pom.xml file? I was
>>>>> wondering
>>>>>>>> whether this was a good practice, or something to be kept only for
>>>>>>>> situations where you really can't avoid it
>>>>>>>>
>>>>>>>> Best regards
>>>>>>>>
>>>>>>>> Jean-Noël
>>>>>>>>
>>>>>>>> On 25 Feb 2013, at 21:31, Ron Wheeler
>>>>> <rw...@artifact-software.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Why not move the production of the software to Maven and leave the
>>>>>>>> assembly in Ant.
>>>>>>>>> That would give you the best of both worlds.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 25/02/2013 2:41 PM, Jean-Noël Colin wrote:
>>>>>>>>>> Hi
>>>>>>>>>>
>>>>>>>>>> I'm trying to migrate my project from ant to maven, but I'm
>>>>> facing a
>>>>>>>> few difficulties; I need to build my project for different
>>>>> environments
>>>>>>>> (customers, so possibly a long list). In my ant project, I had
>>>>> several
>>>>>>>> .properties file, one per customer; in this file, I had properties
>>>>> used to
>>>>>>>> customize some config file; I managed to use resource filtering to
>>>>> achieve
>>>>>>>> this.
>>>>>>>>>> However, some properties defined a filename that needed to be
>>>>> copied
>>>>> to
>>>>>>>> the war archive, but under a common name. For instance, I had
>>>>> several
>>>>>>>> logos: logo_customer1.jpg, logo_customer2.jpg, logo_customer3.jpg;
>>>>> the
>>>>>>>> source file name was specified in the properties file
>>>>>>>> (customer1.properties, customer2.properties, customer3.properties),
>>>>> but the
>>>>>>>> destination was always logo.jpg. How can I do that?
>>>>>>>>>> Second, the properties file defines the name of the file
>>>>> (resources)
>>>>> to
>>>>>>>> be filtered. For instance, I have a template for working with Spring
>>>>>>>> Security in LDAP environment and another template when working when
>>>>> Active
>>>>>>>> Directory; the customer properties file defined the name of the
>>>>> template to
>>>>>>>> use, but in both cases, the result file needs to be
>>>>>>>> applicationContext-security.xml. How can i achieve this? Or is
>>>>> there a
>>>>> way
>>>>>>>> to define conditional profiles so that in the customer .properties
>>>>> file, I
>>>>>>>> would say LDAP or AD, and based on that value, different profile
>>>>> would
>>>>> be
>>>>>>>> used?
>>>>>>>>>> Many thanks for your help
>>>>>>>>>>
>>>>>>>>>> Jean-Noël
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Ron Wheeler
>>>>>>>>> President
>>>>>>>>> Artifact Software Inc
>>>>>>>>> email: rwheeler@artifact-software.com
>>>>>>>>> skype: ronaldmwheeler
>>>>>>>>> phone: 866-970-2435, ext 102
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>>>
>>>>>>>> --
>>>>>>>> Baptiste <Batmat> MATHUS - http://batmat.net
>>>>>>>> Sauvez un arbre,
>>>>>>>> Mangez un castor ! nbsp;! <us...@maven.apache.org>
>>>>>>>>
>>>>>> --
>>>>>> Ron Wheeler
>>>>>> President
>>>>>> Artifact Software Inc
>>>>>> email: rwheeler@artifact-software.com
>>>>>> skype: ronaldmwheeler
>>>>>> phone: 866-970-2435, ext 102
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>
>>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>
>> -- 
>> Ron Wheeler
>> President
>> Artifact Software Inc
>> email: rwheeler@artifact-software.com
>> skype: ronaldmwheeler
>> phone: 866-970-2435, ext 102
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


-- 
Patrick Turcotte
------------------------------------------------
patrick.turcotte@revolutionlinux.com
(819) 780-8955, poste 1129
Sans frais 1-800-996-8955, poste 1129


Re: dynamically select resources and apply filtering

Posted by Jean-Noël Colin <jn...@gmail.com>.
so basically, what you recommend is to use Maven to build a 'standard' war, and then write my own scripts to customize the war to each distinct environment, is that right? 

Jean-Noël

On 26 Feb 2013, at 17:50, Ron Wheeler <rw...@artifact-software.com> wrote:

> Since you want to support a "lot" of customers with different configurations, you may want something that is based on a simple CMS that provides a database and an editing tool and an API for extracting content.
> You script could then navigate the CMS picking up the right pieces to make up the war for each client.
> 
> If you have to deliver updated documentation, release note and revised EULAs, then you might want to use your script to prepare an installer staging area and invoke an installer build package to build a customized installer for each client.
> 
> 
> Ron
> 
> On 26/02/2013 10:49 AM, Lyons, Roy wrote:
>> I say that you could just run a post-deployment command that performs any
>> filtering.  You could use ant, perl, java, whatever you wanted to...  and
>> perhaps have it pull down content from a centralized git repository or
>> something to make it easy to maintain your properties/configs.
>> 
>> The obvious mess comes into play if you are performing deployments using
>> the maven tomcat plugin or something similar instead of a real packaging
>> tool.
>> 
>> 
>> Thanks,
>> 
>> Roy Lyons
>> 
>> 
>> 
>> 
>> 
>> On 2/26/13 9:43 AM, "Stephen Connolly" <st...@gmail.com>
>> wrote:
>> 
>>> I have an answer on Stack Overflow that might help your thought processes:
>>> http://stackoverflow.com/questions/14650468/whats-a-practicable-way-for-au
>>> tomated-configuration-versioning-and-deployment/14661186#14661186
>>> 
>>> 
>>> On 26 February 2013 15:06, Jean-Noël Colin <jn...@gmail.com> wrote:
>>> 
>>>> so your suggestion would be to have maven do the compile, and a kind of
>>>> 'war:exploded', and then run ant to add the customized files and create
>>>> the
>>>> war file, is that correct?
>>>> 
>>>> or should I write a plugin that does that for me?
>>>> 
>>>> You write: "Separating run-time deployment from Maven is a best
>>>> practice";
>>>> but then, what should I use to customise and deploy distribution kits?
>>>> 
>>>> Best
>>>> 
>>>> Jean-Noël
>>>> 
>>>> On 26 Feb 2013, at 10:01, Ron Wheeler <rw...@artifact-software.com>
>>>> wrote:
>>>> 
>>>>> On 26/02/2013 2:54 AM, Baptiste MATHUS wrote:
>>>>>> I *think* Ron means: using maven to produce your standard artifacts
>>>>>> (jar/war/ear ?), and then use pure ant somewhere in the process just
>>>> before
>>>>>> deploying for a specific customer to do the replacements you're
>>>> talking
>>>>>> about.
>>>>>> 
>>>>>> (By the way, invoking ant from maven (using antrun-maven-plugin)
>>>> should
>>>>>> always be considered something bad and temporary. Writing or using a
>>>>>> dedicated maven plugin is the way to go).
>>>>>> 
>>>>> Exactly.
>>>>> My suggestion would be to run the ant after all the maven work is
>>>> complete and you have a full set of release files in your repo
>>>>> Have Ant (or some other process) merge the released code with
>>>> configuration files, logos, etc to make distribution kits.
>>>>> Ron
>>>>>> 2013/2/26 Jean-Noël Colin <jn...@gmail.com>
>>>>>> 
>>>>>>> Hi Ron,
>>>>>>> 
>>>>>>> Do you mean invoking the ant plugin from the pom.xml file? I was
>>>> wondering
>>>>>>> whether this was a good practice, or something to be kept only for
>>>>>>> situations where you really can't avoid it
>>>>>>> 
>>>>>>> Best regards
>>>>>>> 
>>>>>>> Jean-Noël
>>>>>>> 
>>>>>>> On 25 Feb 2013, at 21:31, Ron Wheeler
>>>> <rw...@artifact-software.com>
>>>>>>> wrote:
>>>>>>> 
>>>>>>>> Why not move the production of the software to Maven and leave the
>>>>>>> assembly in Ant.
>>>>>>>> That would give you the best of both worlds.
>>>>>>>> 
>>>>>>>> 
>>>>>>>> On 25/02/2013 2:41 PM, Jean-Noël Colin wrote:
>>>>>>>>> Hi
>>>>>>>>> 
>>>>>>>>> I'm trying to migrate my project from ant to maven, but I'm
>>>> facing a
>>>>>>> few difficulties; I need to build my project for different
>>>> environments
>>>>>>> (customers, so possibly a long list). In my ant project, I had
>>>> several
>>>>>>> .properties file, one per customer; in this file, I had properties
>>>> used to
>>>>>>> customize some config file; I managed to use resource filtering to
>>>> achieve
>>>>>>> this.
>>>>>>>>> However, some properties defined a filename that needed to be
>>>> copied
>>>> to
>>>>>>> the war archive, but under a common name. For instance, I had
>>>> several
>>>>>>> logos: logo_customer1.jpg, logo_customer2.jpg, logo_customer3.jpg;
>>>> the
>>>>>>> source file name was specified in the properties file
>>>>>>> (customer1.properties, customer2.properties, customer3.properties),
>>>> but the
>>>>>>> destination was always logo.jpg. How can I do that?
>>>>>>>>> Second, the properties file defines the name of the file
>>>> (resources)
>>>> to
>>>>>>> be filtered. For instance, I have a template for working with Spring
>>>>>>> Security in LDAP environment and another template when working when
>>>> Active
>>>>>>> Directory; the customer properties file defined the name of the
>>>> template to
>>>>>>> use, but in both cases, the result file needs to be
>>>>>>> applicationContext-security.xml. How can i achieve this? Or is
>>>> there a
>>>> way
>>>>>>> to define conditional profiles so that in the customer .properties
>>>> file, I
>>>>>>> would say LDAP or AD, and based on that value, different profile
>>>> would
>>>> be
>>>>>>> used?
>>>>>>>>> Many thanks for your help
>>>>>>>>> 
>>>>>>>>> Jean-Noël
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>> ---------------------------------------------------------------------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>> --
>>>>>>>> Ron Wheeler
>>>>>>>> President
>>>>>>>> Artifact Software Inc
>>>>>>>> email: rwheeler@artifact-software.com
>>>>>>>> skype: ronaldmwheeler
>>>>>>>> phone: 866-970-2435, ext 102
>>>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>>> 
>>>>>>> 
>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>> 
>>>>>>> --
>>>>>>> Baptiste <Batmat> MATHUS - http://batmat.net
>>>>>>> Sauvez un arbre,
>>>>>>> Mangez un castor ! nbsp;! <us...@maven.apache.org>
>>>>>>> 
>>>>> 
>>>>> --
>>>>> Ron Wheeler
>>>>> President
>>>>> Artifact Software Inc
>>>>> email: rwheeler@artifact-software.com
>>>>> skype: ronaldmwheeler
>>>>> phone: 866-970-2435, ext 102
>>>>> 
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>> 
>>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 
> 
> 
> -- 
> Ron Wheeler
> President
> Artifact Software Inc
> email: rwheeler@artifact-software.com
> skype: ronaldmwheeler
> phone: 866-970-2435, ext 102
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: dynamically select resources and apply filtering

Posted by Ron Wheeler <rw...@artifact-software.com>.
Since you want to support a "lot" of customers with different 
configurations, you may want something that is based on a simple CMS 
that provides a database and an editing tool and an API for extracting 
content.
You script could then navigate the CMS picking up the right pieces to 
make up the war for each client.

If you have to deliver updated documentation, release note and revised 
EULAs, then you might want to use your script to prepare an installer 
staging area and invoke an installer build package to build a customized 
installer for each client.


Ron

On 26/02/2013 10:49 AM, Lyons, Roy wrote:
> I say that you could just run a post-deployment command that performs any
> filtering.  You could use ant, perl, java, whatever you wanted to...  and
> perhaps have it pull down content from a centralized git repository or
> something to make it easy to maintain your properties/configs.
>
> The obvious mess comes into play if you are performing deployments using
> the maven tomcat plugin or something similar instead of a real packaging
> tool.
>
>
> Thanks,
>
> Roy Lyons
>
>
>
>
>
> On 2/26/13 9:43 AM, "Stephen Connolly" <st...@gmail.com>
> wrote:
>
>> I have an answer on Stack Overflow that might help your thought processes:
>> http://stackoverflow.com/questions/14650468/whats-a-practicable-way-for-au
>> tomated-configuration-versioning-and-deployment/14661186#14661186
>>
>>
>> On 26 February 2013 15:06, Jean-Noël Colin <jn...@gmail.com> wrote:
>>
>>> so your suggestion would be to have maven do the compile, and a kind of
>>> 'war:exploded', and then run ant to add the customized files and create
>>> the
>>> war file, is that correct?
>>>
>>> or should I write a plugin that does that for me?
>>>
>>> You write: "Separating run-time deployment from Maven is a best
>>> practice";
>>> but then, what should I use to customise and deploy distribution kits?
>>>
>>> Best
>>>
>>> Jean-Noël
>>>
>>> On 26 Feb 2013, at 10:01, Ron Wheeler <rw...@artifact-software.com>
>>> wrote:
>>>
>>>> On 26/02/2013 2:54 AM, Baptiste MATHUS wrote:
>>>>> I *think* Ron means: using maven to produce your standard artifacts
>>>>> (jar/war/ear ?), and then use pure ant somewhere in the process just
>>> before
>>>>> deploying for a specific customer to do the replacements you're
>>> talking
>>>>> about.
>>>>>
>>>>> (By the way, invoking ant from maven (using antrun-maven-plugin)
>>> should
>>>>> always be considered something bad and temporary. Writing or using a
>>>>> dedicated maven plugin is the way to go).
>>>>>
>>>> Exactly.
>>>> My suggestion would be to run the ant after all the maven work is
>>> complete and you have a full set of release files in your repo
>>>> Have Ant (or some other process) merge the released code with
>>> configuration files, logos, etc to make distribution kits.
>>>> Ron
>>>>> 2013/2/26 Jean-Noël Colin <jn...@gmail.com>
>>>>>
>>>>>> Hi Ron,
>>>>>>
>>>>>> Do you mean invoking the ant plugin from the pom.xml file? I was
>>> wondering
>>>>>> whether this was a good practice, or something to be kept only for
>>>>>> situations where you really can't avoid it
>>>>>>
>>>>>> Best regards
>>>>>>
>>>>>> Jean-Noël
>>>>>>
>>>>>> On 25 Feb 2013, at 21:31, Ron Wheeler
>>> <rw...@artifact-software.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Why not move the production of the software to Maven and leave the
>>>>>> assembly in Ant.
>>>>>>> That would give you the best of both worlds.
>>>>>>>
>>>>>>>
>>>>>>> On 25/02/2013 2:41 PM, Jean-Noël Colin wrote:
>>>>>>>> Hi
>>>>>>>>
>>>>>>>> I'm trying to migrate my project from ant to maven, but I'm
>>> facing a
>>>>>> few difficulties; I need to build my project for different
>>> environments
>>>>>> (customers, so possibly a long list). In my ant project, I had
>>> several
>>>>>> .properties file, one per customer; in this file, I had properties
>>> used to
>>>>>> customize some config file; I managed to use resource filtering to
>>> achieve
>>>>>> this.
>>>>>>>> However, some properties defined a filename that needed to be
>>> copied
>>> to
>>>>>> the war archive, but under a common name. For instance, I had
>>> several
>>>>>> logos: logo_customer1.jpg, logo_customer2.jpg, logo_customer3.jpg;
>>> the
>>>>>> source file name was specified in the properties file
>>>>>> (customer1.properties, customer2.properties, customer3.properties),
>>> but the
>>>>>> destination was always logo.jpg. How can I do that?
>>>>>>>> Second, the properties file defines the name of the file
>>> (resources)
>>> to
>>>>>> be filtered. For instance, I have a template for working with Spring
>>>>>> Security in LDAP environment and another template when working when
>>> Active
>>>>>> Directory; the customer properties file defined the name of the
>>> template to
>>>>>> use, but in both cases, the result file needs to be
>>>>>> applicationContext-security.xml. How can i achieve this? Or is
>>> there a
>>> way
>>>>>> to define conditional profiles so that in the customer .properties
>>> file, I
>>>>>> would say LDAP or AD, and based on that value, different profile
>>> would
>>> be
>>>>>> used?
>>>>>>>> Many thanks for your help
>>>>>>>>
>>>>>>>> Jean-Noël
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>> --
>>>>>>> Ron Wheeler
>>>>>>> President
>>>>>>> Artifact Software Inc
>>>>>>> email: rwheeler@artifact-software.com
>>>>>>> skype: ronaldmwheeler
>>>>>>> phone: 866-970-2435, ext 102
>>>>>>>
>>>>>>>
>>>>>>>
>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>>
>>>>>>
>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>
>>>>>> --
>>>>>> Baptiste <Batmat> MATHUS - http://batmat.net
>>>>>> Sauvez un arbre,
>>>>>> Mangez un castor ! nbsp;! <us...@maven.apache.org>
>>>>>>
>>>>
>>>> --
>>>> Ron Wheeler
>>>> President
>>>> Artifact Software Inc
>>>> email: rwheeler@artifact-software.com
>>>> skype: ronaldmwheeler
>>>> phone: 866-970-2435, ext 102
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: dynamically select resources and apply filtering

Posted by "Lyons, Roy" <Ro...@cmegroup.com>.
I say that you could just run a post-deployment command that performs any
filtering.  You could use ant, perl, java, whatever you wanted to...  and
perhaps have it pull down content from a centralized git repository or
something to make it easy to maintain your properties/configs.

The obvious mess comes into play if you are performing deployments using
the maven tomcat plugin or something similar instead of a real packaging
tool.


Thanks,

Roy Lyons





On 2/26/13 9:43 AM, "Stephen Connolly" <st...@gmail.com>
wrote:

>I have an answer on Stack Overflow that might help your thought processes:
>http://stackoverflow.com/questions/14650468/whats-a-practicable-way-for-au
>tomated-configuration-versioning-and-deployment/14661186#14661186
>
>
>On 26 February 2013 15:06, Jean-Noël Colin <jn...@gmail.com> wrote:
>
>> so your suggestion would be to have maven do the compile, and a kind of
>> 'war:exploded', and then run ant to add the customized files and create
>>the
>> war file, is that correct?
>>
>> or should I write a plugin that does that for me?
>>
>> You write: "Separating run-time deployment from Maven is a best
>>practice";
>> but then, what should I use to customise and deploy distribution kits?
>>
>> Best
>>
>> Jean-Noël
>>
>> On 26 Feb 2013, at 10:01, Ron Wheeler <rw...@artifact-software.com>
>> wrote:
>>
>> > On 26/02/2013 2:54 AM, Baptiste MATHUS wrote:
>> >> I *think* Ron means: using maven to produce your standard artifacts
>> >> (jar/war/ear ?), and then use pure ant somewhere in the process just
>> before
>> >> deploying for a specific customer to do the replacements you're
>>talking
>> >> about.
>> >>
>> >> (By the way, invoking ant from maven (using antrun-maven-plugin)
>>should
>> >> always be considered something bad and temporary. Writing or using a
>> >> dedicated maven plugin is the way to go).
>> >>
>> > Exactly.
>> > My suggestion would be to run the ant after all the maven work is
>> complete and you have a full set of release files in your repo
>> > Have Ant (or some other process) merge the released code with
>> configuration files, logos, etc to make distribution kits.
>> >
>> > Ron
>> >> 2013/2/26 Jean-Noël Colin <jn...@gmail.com>
>> >>
>> >>> Hi Ron,
>> >>>
>> >>> Do you mean invoking the ant plugin from the pom.xml file? I was
>> wondering
>> >>> whether this was a good practice, or something to be kept only for
>> >>> situations where you really can't avoid it
>> >>>
>> >>> Best regards
>> >>>
>> >>> Jean-Noël
>> >>>
>> >>> On 25 Feb 2013, at 21:31, Ron Wheeler
>><rw...@artifact-software.com>
>> >>> wrote:
>> >>>
>> >>>> Why not move the production of the software to Maven and leave the
>> >>> assembly in Ant.
>> >>>> That would give you the best of both worlds.
>> >>>>
>> >>>>
>> >>>> On 25/02/2013 2:41 PM, Jean-Noël Colin wrote:
>> >>>>> Hi
>> >>>>>
>> >>>>> I'm trying to migrate my project from ant to maven, but I'm
>>facing a
>> >>> few difficulties; I need to build my project for different
>>environments
>> >>> (customers, so possibly a long list). In my ant project, I had
>>several
>> >>> .properties file, one per customer; in this file, I had properties
>> used to
>> >>> customize some config file; I managed to use resource filtering to
>> achieve
>> >>> this.
>> >>>>> However, some properties defined a filename that needed to be
>>copied
>> to
>> >>> the war archive, but under a common name. For instance, I had
>>several
>> >>> logos: logo_customer1.jpg, logo_customer2.jpg, logo_customer3.jpg;
>>the
>> >>> source file name was specified in the properties file
>> >>> (customer1.properties, customer2.properties, customer3.properties),
>> but the
>> >>> destination was always logo.jpg. How can I do that?
>> >>>>> Second, the properties file defines the name of the file
>>(resources)
>> to
>> >>> be filtered. For instance, I have a template for working with Spring
>> >>> Security in LDAP environment and another template when working when
>> Active
>> >>> Directory; the customer properties file defined the name of the
>> template to
>> >>> use, but in both cases, the result file needs to be
>> >>> applicationContext-security.xml. How can i achieve this? Or is
>>there a
>> way
>> >>> to define conditional profiles so that in the customer .properties
>> file, I
>> >>> would say LDAP or AD, and based on that value, different profile
>>would
>> be
>> >>> used?
>> >>>>> Many thanks for your help
>> >>>>>
>> >>>>> Jean-Noël
>> >>>>>
>> >>>>>
>> >>>>> 
>>---------------------------------------------------------------------
>> >>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >>>>> For additional commands, e-mail: users-help@maven.apache.org
>> >>>>>
>> >>>>>
>> >>>>
>> >>>> --
>> >>>> Ron Wheeler
>> >>>> President
>> >>>> Artifact Software Inc
>> >>>> email: rwheeler@artifact-software.com
>> >>>> skype: ronaldmwheeler
>> >>>> phone: 866-970-2435, ext 102
>> >>>>
>> >>>>
>> >>>> 
>>---------------------------------------------------------------------
>> >>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >>>> For additional commands, e-mail: users-help@maven.apache.org
>> >>>>
>> >>>
>> >>> 
>>---------------------------------------------------------------------
>> >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >>> For additional commands, e-mail: users-help@maven.apache.org
>> >>>
>> >>> --
>> >>> Baptiste <Batmat> MATHUS - http://batmat.net
>> >>> Sauvez un arbre,
>> >>> Mangez un castor ! nbsp;! <us...@maven.apache.org>
>> >>>
>> >
>> >
>> > --
>> > Ron Wheeler
>> > President
>> > Artifact Software Inc
>> > email: rwheeler@artifact-software.com
>> > skype: ronaldmwheeler
>> > phone: 866-970-2435, ext 102
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> > For additional commands, e-mail: users-help@maven.apache.org
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: dynamically select resources and apply filtering

Posted by Stephen Connolly <st...@gmail.com>.
I have an answer on Stack Overflow that might help your thought processes:
http://stackoverflow.com/questions/14650468/whats-a-practicable-way-for-automated-configuration-versioning-and-deployment/14661186#14661186


On 26 February 2013 15:06, Jean-Noël Colin <jn...@gmail.com> wrote:

> so your suggestion would be to have maven do the compile, and a kind of
> 'war:exploded', and then run ant to add the customized files and create the
> war file, is that correct?
>
> or should I write a plugin that does that for me?
>
> You write: "Separating run-time deployment from Maven is a best practice";
> but then, what should I use to customise and deploy distribution kits?
>
> Best
>
> Jean-Noël
>
> On 26 Feb 2013, at 10:01, Ron Wheeler <rw...@artifact-software.com>
> wrote:
>
> > On 26/02/2013 2:54 AM, Baptiste MATHUS wrote:
> >> I *think* Ron means: using maven to produce your standard artifacts
> >> (jar/war/ear ?), and then use pure ant somewhere in the process just
> before
> >> deploying for a specific customer to do the replacements you're talking
> >> about.
> >>
> >> (By the way, invoking ant from maven (using antrun-maven-plugin) should
> >> always be considered something bad and temporary. Writing or using a
> >> dedicated maven plugin is the way to go).
> >>
> > Exactly.
> > My suggestion would be to run the ant after all the maven work is
> complete and you have a full set of release files in your repo
> > Have Ant (or some other process) merge the released code with
> configuration files, logos, etc to make distribution kits.
> >
> > Ron
> >> 2013/2/26 Jean-Noël Colin <jn...@gmail.com>
> >>
> >>> Hi Ron,
> >>>
> >>> Do you mean invoking the ant plugin from the pom.xml file? I was
> wondering
> >>> whether this was a good practice, or something to be kept only for
> >>> situations where you really can't avoid it
> >>>
> >>> Best regards
> >>>
> >>> Jean-Noël
> >>>
> >>> On 25 Feb 2013, at 21:31, Ron Wheeler <rw...@artifact-software.com>
> >>> wrote:
> >>>
> >>>> Why not move the production of the software to Maven and leave the
> >>> assembly in Ant.
> >>>> That would give you the best of both worlds.
> >>>>
> >>>>
> >>>> On 25/02/2013 2:41 PM, Jean-Noël Colin wrote:
> >>>>> Hi
> >>>>>
> >>>>> I'm trying to migrate my project from ant to maven, but I'm facing a
> >>> few difficulties; I need to build my project for different environments
> >>> (customers, so possibly a long list). In my ant project, I had several
> >>> .properties file, one per customer; in this file, I had properties
> used to
> >>> customize some config file; I managed to use resource filtering to
> achieve
> >>> this.
> >>>>> However, some properties defined a filename that needed to be copied
> to
> >>> the war archive, but under a common name. For instance, I had several
> >>> logos: logo_customer1.jpg, logo_customer2.jpg, logo_customer3.jpg; the
> >>> source file name was specified in the properties file
> >>> (customer1.properties, customer2.properties, customer3.properties),
> but the
> >>> destination was always logo.jpg. How can I do that?
> >>>>> Second, the properties file defines the name of the file (resources)
> to
> >>> be filtered. For instance, I have a template for working with Spring
> >>> Security in LDAP environment and another template when working when
> Active
> >>> Directory; the customer properties file defined the name of the
> template to
> >>> use, but in both cases, the result file needs to be
> >>> applicationContext-security.xml. How can i achieve this? Or is there a
> way
> >>> to define conditional profiles so that in the customer .properties
> file, I
> >>> would say LDAP or AD, and based on that value, different profile would
> be
> >>> used?
> >>>>> Many thanks for your help
> >>>>>
> >>>>> Jean-Noël
> >>>>>
> >>>>>
> >>>>> ---------------------------------------------------------------------
> >>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>>
> >>>>>
> >>>>
> >>>> --
> >>>> Ron Wheeler
> >>>> President
> >>>> Artifact Software Inc
> >>>> email: rwheeler@artifact-software.com
> >>>> skype: ronaldmwheeler
> >>>> phone: 866-970-2435, ext 102
> >>>>
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>> For additional commands, e-mail: users-help@maven.apache.org
> >>>
> >>> --
> >>> Baptiste <Batmat> MATHUS - http://batmat.net
> >>> Sauvez un arbre,
> >>> Mangez un castor ! nbsp;! <us...@maven.apache.org>
> >>>
> >
> >
> > --
> > Ron Wheeler
> > President
> > Artifact Software Inc
> > email: rwheeler@artifact-software.com
> > skype: ronaldmwheeler
> > phone: 866-970-2435, ext 102
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: dynamically select resources and apply filtering

Posted by Jean-Noël Colin <jn...@gmail.com>.
so your suggestion would be to have maven do the compile, and a kind of 'war:exploded', and then run ant to add the customized files and create the war file, is that correct? 

or should I write a plugin that does that for me? 

You write: "Separating run-time deployment from Maven is a best practice"; but then, what should I use to customise and deploy distribution kits?

Best 

Jean-Noël

On 26 Feb 2013, at 10:01, Ron Wheeler <rw...@artifact-software.com> wrote:

> On 26/02/2013 2:54 AM, Baptiste MATHUS wrote:
>> I *think* Ron means: using maven to produce your standard artifacts
>> (jar/war/ear ?), and then use pure ant somewhere in the process just before
>> deploying for a specific customer to do the replacements you're talking
>> about.
>> 
>> (By the way, invoking ant from maven (using antrun-maven-plugin) should
>> always be considered something bad and temporary. Writing or using a
>> dedicated maven plugin is the way to go).
>> 
> Exactly.
> My suggestion would be to run the ant after all the maven work is complete and you have a full set of release files in your repo
> Have Ant (or some other process) merge the released code with configuration files, logos, etc to make distribution kits.
> 
> Ron
>> 2013/2/26 Jean-Noël Colin <jn...@gmail.com>
>> 
>>> Hi Ron,
>>> 
>>> Do you mean invoking the ant plugin from the pom.xml file? I was wondering
>>> whether this was a good practice, or something to be kept only for
>>> situations where you really can't avoid it
>>> 
>>> Best regards
>>> 
>>> Jean-Noël
>>> 
>>> On 25 Feb 2013, at 21:31, Ron Wheeler <rw...@artifact-software.com>
>>> wrote:
>>> 
>>>> Why not move the production of the software to Maven and leave the
>>> assembly in Ant.
>>>> That would give you the best of both worlds.
>>>> 
>>>> 
>>>> On 25/02/2013 2:41 PM, Jean-Noël Colin wrote:
>>>>> Hi
>>>>> 
>>>>> I'm trying to migrate my project from ant to maven, but I'm facing a
>>> few difficulties; I need to build my project for different environments
>>> (customers, so possibly a long list). In my ant project, I had several
>>> .properties file, one per customer; in this file, I had properties used to
>>> customize some config file; I managed to use resource filtering to achieve
>>> this.
>>>>> However, some properties defined a filename that needed to be copied to
>>> the war archive, but under a common name. For instance, I had several
>>> logos: logo_customer1.jpg, logo_customer2.jpg, logo_customer3.jpg; the
>>> source file name was specified in the properties file
>>> (customer1.properties, customer2.properties, customer3.properties), but the
>>> destination was always logo.jpg. How can I do that?
>>>>> Second, the properties file defines the name of the file (resources) to
>>> be filtered. For instance, I have a template for working with Spring
>>> Security in LDAP environment and another template when working when Active
>>> Directory; the customer properties file defined the name of the template to
>>> use, but in both cases, the result file needs to be
>>> applicationContext-security.xml. How can i achieve this? Or is there a way
>>> to define conditional profiles so that in the customer .properties file, I
>>> would say LDAP or AD, and based on that value, different profile would be
>>> used?
>>>>> Many thanks for your help
>>>>> 
>>>>> Jean-Noël
>>>>> 
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>> 
>>>>> 
>>>> 
>>>> --
>>>> Ron Wheeler
>>>> President
>>>> Artifact Software Inc
>>>> email: rwheeler@artifact-software.com
>>>> skype: ronaldmwheeler
>>>> phone: 866-970-2435, ext 102
>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>> 
>>> --
>>> Baptiste <Batmat> MATHUS - http://batmat.net
>>> Sauvez un arbre,
>>> Mangez un castor ! nbsp;! <us...@maven.apache.org>
>>> 
> 
> 
> -- 
> Ron Wheeler
> President
> Artifact Software Inc
> email: rwheeler@artifact-software.com
> skype: ronaldmwheeler
> phone: 866-970-2435, ext 102
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: dynamically select resources and apply filtering

Posted by Ron Wheeler <rw...@artifact-software.com>.
On 26/02/2013 2:54 AM, Baptiste MATHUS wrote:
> I *think* Ron means: using maven to produce your standard artifacts
> (jar/war/ear ?), and then use pure ant somewhere in the process just before
> deploying for a specific customer to do the replacements you're talking
> about.
>
> (By the way, invoking ant from maven (using antrun-maven-plugin) should
> always be considered something bad and temporary. Writing or using a
> dedicated maven plugin is the way to go).
>
Exactly.
My suggestion would be to run the ant after all the maven work is 
complete and you have a full set of release files in your repo
Have Ant (or some other process) merge the released code with 
configuration files, logos, etc to make distribution kits.

Ron
> 2013/2/26 Jean-Noël Colin <jn...@gmail.com>
>
>> Hi Ron,
>>
>> Do you mean invoking the ant plugin from the pom.xml file? I was wondering
>> whether this was a good practice, or something to be kept only for
>> situations where you really can't avoid it
>>
>> Best regards
>>
>> Jean-Noël
>>
>> On 25 Feb 2013, at 21:31, Ron Wheeler <rw...@artifact-software.com>
>> wrote:
>>
>>> Why not move the production of the software to Maven and leave the
>> assembly in Ant.
>>> That would give you the best of both worlds.
>>>
>>>
>>> On 25/02/2013 2:41 PM, Jean-Noël Colin wrote:
>>>> Hi
>>>>
>>>> I'm trying to migrate my project from ant to maven, but I'm facing a
>> few difficulties; I need to build my project for different environments
>> (customers, so possibly a long list). In my ant project, I had several
>> .properties file, one per customer; in this file, I had properties used to
>> customize some config file; I managed to use resource filtering to achieve
>> this.
>>>> However, some properties defined a filename that needed to be copied to
>> the war archive, but under a common name. For instance, I had several
>> logos: logo_customer1.jpg, logo_customer2.jpg, logo_customer3.jpg; the
>> source file name was specified in the properties file
>> (customer1.properties, customer2.properties, customer3.properties), but the
>> destination was always logo.jpg. How can I do that?
>>>> Second, the properties file defines the name of the file (resources) to
>> be filtered. For instance, I have a template for working with Spring
>> Security in LDAP environment and another template when working when Active
>> Directory; the customer properties file defined the name of the template to
>> use, but in both cases, the result file needs to be
>> applicationContext-security.xml. How can i achieve this? Or is there a way
>> to define conditional profiles so that in the customer .properties file, I
>> would say LDAP or AD, and based on that value, different profile would be
>> used?
>>>> Many thanks for your help
>>>>
>>>> Jean-Noël
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>>
>>> --
>>> Ron Wheeler
>>> President
>>> Artifact Software Inc
>>> email: rwheeler@artifact-software.com
>>> skype: ronaldmwheeler
>>> phone: 866-970-2435, ext 102
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>> --
>> Baptiste <Batmat> MATHUS - http://batmat.net
>> Sauvez un arbre,
>> Mangez un castor ! nbsp;! <us...@maven.apache.org>
>>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: dynamically select resources and apply filtering

Posted by Baptiste MATHUS <ml...@batmat.net>.
I *think* Ron means: using maven to produce your standard artifacts
(jar/war/ear ?), and then use pure ant somewhere in the process just before
deploying for a specific customer to do the replacements you're talking
about.

(By the way, invoking ant from maven (using antrun-maven-plugin) should
always be considered something bad and temporary. Writing or using a
dedicated maven plugin is the way to go).


2013/2/26 Jean-Noël Colin <jn...@gmail.com>

> Hi Ron,
>
> Do you mean invoking the ant plugin from the pom.xml file? I was wondering
> whether this was a good practice, or something to be kept only for
> situations where you really can't avoid it
>
> Best regards
>
> Jean-Noël
>
> On 25 Feb 2013, at 21:31, Ron Wheeler <rw...@artifact-software.com>
> wrote:
>
> > Why not move the production of the software to Maven and leave the
> assembly in Ant.
> > That would give you the best of both worlds.
> >
> >
> > On 25/02/2013 2:41 PM, Jean-Noël Colin wrote:
> >> Hi
> >>
> >> I'm trying to migrate my project from ant to maven, but I'm facing a
> few difficulties; I need to build my project for different environments
> (customers, so possibly a long list). In my ant project, I had several
> .properties file, one per customer; in this file, I had properties used to
> customize some config file; I managed to use resource filtering to achieve
> this.
> >>
> >> However, some properties defined a filename that needed to be copied to
> the war archive, but under a common name. For instance, I had several
> logos: logo_customer1.jpg, logo_customer2.jpg, logo_customer3.jpg; the
> source file name was specified in the properties file
> (customer1.properties, customer2.properties, customer3.properties), but the
> destination was always logo.jpg. How can I do that?
> >>
> >> Second, the properties file defines the name of the file (resources) to
> be filtered. For instance, I have a template for working with Spring
> Security in LDAP environment and another template when working when Active
> Directory; the customer properties file defined the name of the template to
> use, but in both cases, the result file needs to be
> applicationContext-security.xml. How can i achieve this? Or is there a way
> to define conditional profiles so that in the customer .properties file, I
> would say LDAP or AD, and based on that value, different profile would be
> used?
> >>
> >> Many thanks for your help
> >>
> >> Jean-Noël
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
> >
> > --
> > Ron Wheeler
> > President
> > Artifact Software Inc
> > email: rwheeler@artifact-software.com
> > skype: ronaldmwheeler
> > phone: 866-970-2435, ext 102
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
> --
> Baptiste <Batmat> MATHUS - http://batmat.net
> Sauvez un arbre,
> Mangez un castor ! nbsp;! <us...@maven.apache.org>
>

Re: dynamically select resources and apply filtering

Posted by Ron Wheeler <rw...@artifact-software.com>.
On 26/02/2013 2:34 AM, Jean-Noël Colin wrote:
> Hi Ron,
>
> Do you mean invoking the ant plugin from the pom.xml file? I was wondering whether this was a good practice, or something to be kept only for situations where you really can't avoid it
It would probably not be described as a best practice but it might be a 
better practice than some of the other alternatives.

Moving run-time dependencies out of developers hands is a best practice.
Separating run-time deployment from Maven is a best practice.

It sounds like you need a system to manage building software 
distributions that are targeted at specific customers.
Maven is  a tool that is focused on building one artifact from one set 
of code.

It would seem that you might be happiest if you build your code jars 
with maven and build your software installation kits with another 
product that has a database of configuration files and some instructions 
about how to build the software that each client needs.

Ron
> Best regards
>
> Jean-Noël
>
> On 25 Feb 2013, at 21:31, Ron Wheeler <rw...@artifact-software.com> wrote:
>
>> Why not move the production of the software to Maven and leave the assembly in Ant.
>> That would give you the best of both worlds.
>>
>>
>> On 25/02/2013 2:41 PM, Jean-Noël Colin wrote:
>>> Hi
>>>
>>> I'm trying to migrate my project from ant to maven, but I'm facing a few difficulties; I need to build my project for different environments (customers, so possibly a long list). In my ant project, I had several .properties file, one per customer; in this file, I had properties used to customize some config file; I managed to use resource filtering to achieve this.
>>>
>>> However, some properties defined a filename that needed to be copied to the war archive, but under a common name. For instance, I had several logos: logo_customer1.jpg, logo_customer2.jpg, logo_customer3.jpg; the source file name was specified in the properties file (customer1.properties, customer2.properties, customer3.properties), but the destination was always logo.jpg. How can I do that?
>>>
>>> Second, the properties file defines the name of the file (resources) to be filtered. For instance, I have a template for working with Spring Security in LDAP environment and another template when working when Active Directory; the customer properties file defined the name of the template to use, but in both cases, the result file needs to be applicationContext-security.xml. How can i achieve this? Or is there a way to define conditional profiles so that in the customer .properties file, I would say LDAP or AD, and based on that value, different profile would be used?
>>>
>>> Many thanks for your help
>>>
>>> Jean-Noël
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>
>> -- 
>> Ron Wheeler
>> President
>> Artifact Software Inc
>> email: rwheeler@artifact-software.com
>> skype: ronaldmwheeler
>> phone: 866-970-2435, ext 102
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: dynamically select resources and apply filtering

Posted by Jean-Noël Colin <jn...@gmail.com>.
Hi Ron, 

Do you mean invoking the ant plugin from the pom.xml file? I was wondering whether this was a good practice, or something to be kept only for situations where you really can't avoid it

Best regards

Jean-Noël

On 25 Feb 2013, at 21:31, Ron Wheeler <rw...@artifact-software.com> wrote:

> Why not move the production of the software to Maven and leave the assembly in Ant.
> That would give you the best of both worlds.
> 
> 
> On 25/02/2013 2:41 PM, Jean-Noël Colin wrote:
>> Hi
>> 
>> I'm trying to migrate my project from ant to maven, but I'm facing a few difficulties; I need to build my project for different environments (customers, so possibly a long list). In my ant project, I had several .properties file, one per customer; in this file, I had properties used to customize some config file; I managed to use resource filtering to achieve this.
>> 
>> However, some properties defined a filename that needed to be copied to the war archive, but under a common name. For instance, I had several logos: logo_customer1.jpg, logo_customer2.jpg, logo_customer3.jpg; the source file name was specified in the properties file (customer1.properties, customer2.properties, customer3.properties), but the destination was always logo.jpg. How can I do that?
>> 
>> Second, the properties file defines the name of the file (resources) to be filtered. For instance, I have a template for working with Spring Security in LDAP environment and another template when working when Active Directory; the customer properties file defined the name of the template to use, but in both cases, the result file needs to be applicationContext-security.xml. How can i achieve this? Or is there a way to define conditional profiles so that in the customer .properties file, I would say LDAP or AD, and based on that value, different profile would be used?
>> 
>> Many thanks for your help
>> 
>> Jean-Noël
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>> 
> 
> 
> -- 
> Ron Wheeler
> President
> Artifact Software Inc
> email: rwheeler@artifact-software.com
> skype: ronaldmwheeler
> phone: 866-970-2435, ext 102
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: dynamically select resources and apply filtering

Posted by Ron Wheeler <rw...@artifact-software.com>.
Why not move the production of the software to Maven and leave the 
assembly in Ant.
That would give you the best of both worlds.


On 25/02/2013 2:41 PM, Jean-Noël Colin wrote:
> Hi
>
> I'm trying to migrate my project from ant to maven, but I'm facing a few difficulties; I need to build my project for different environments (customers, so possibly a long list). In my ant project, I had several .properties file, one per customer; in this file, I had properties used to customize some config file; I managed to use resource filtering to achieve this.
>
> However, some properties defined a filename that needed to be copied to the war archive, but under a common name. For instance, I had several logos: logo_customer1.jpg, logo_customer2.jpg, logo_customer3.jpg; the source file name was specified in the properties file (customer1.properties, customer2.properties, customer3.properties), but the destination was always logo.jpg. How can I do that?
>
> Second, the properties file defines the name of the file (resources) to be filtered. For instance, I have a template for working with Spring Security in LDAP environment and another template when working when Active Directory; the customer properties file defined the name of the template to use, but in both cases, the result file needs to be applicationContext-security.xml. How can i achieve this? Or is there a way to define conditional profiles so that in the customer .properties file, I would say LDAP or AD, and based on that value, different profile would be used?
>
> Many thanks for your help
>
> Jean-Noël
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Ron Wheeler
President
Artifact Software Inc
email: rwheeler@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org