You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Olivier Lamy <ol...@accor.com> on 2005/12/09 21:46:51 UTC

RE : What is the proper way to handle properties files based on the environment you are building for?

Use differents profiles (with differents resources definitions).
The default can be the dev one.
Then use mvn -P prod package to build the production war.

- Olivier

-----Message d'origine-----
De : Frank Russo [mailto:frank.russo@FXALL.com] 
Envoyé : vendredi 9 décembre 2005 20:42
À : users@maven.apache.org
Objet : What is the proper way to handle properties files based on the
environment you are building for?


I'm building a webapp. Our webapp depends on some environment specific
variables that are defined in a group of properties files. Depending on
the environment I want to build for, i.e., dev, qa, prod, I build the
war as follows: mvn -Denv=ENV_VAR clean package.
 
Our package structure for the properties files is: 

	src
	|
	----main
	    |
	    ----resources
	        |
	        ----dev
	            |
	            ----*.properties
	        |
	        ----qa 
	            |
	            ----*.properties
	        |
	        ----prod 
	            |
	            ----*.properties

Depending on the value of -Denv=ENV_VAR, (e.g. -Denv=dev), the proper
grouping of properties files get put into my web-inf/classes directory. 
 
Is this the proper way of doing this, or is there another way? The
reason I'm asking is that, say someone does a build forgetting to add
this. Then the build will still work, except that all files, including
the folder structure, are added to the war without warning. This
probably won't be caught until we deploy the app.
 
Thanks...
Frank Russo
Senior Developer
FX Alliance, LLC




This e-mail, any attachments and the information contained therein ("this message") are confidential and intended solely for the use of the addressee(s). If you have received this message in error please send it back to the sender and delete it. Unauthorized publication, use, dissemination or disclosure of this message, either in whole or in part is strictly prohibited.
--------------------------------------------------------------------------------------------------------------
Ce message électronique et tous les fichiers joints ainsi que  les informations contenues dans ce message ( ci après "le message" ), sont confidentiels et destinés exclusivement à l'usage de la  personne à laquelle ils sont adressés. Si vous avez reçu ce message par erreur, merci  de le renvoyer à son émetteur et de le détruire. Toutes diffusion, publication, totale ou partielle ou divulgation sous quelque forme que se soit non expressément autorisées de ce message, sont interdites.
-------------------------------------------------------------------------------------------------------------


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