This works for a default profile arrangement.
"mvn compile" will utilize the local profile and would be my default profile. "mvn -Denv=dev compile" will use the dev profile. but "mvn -Denv=local compile" will cause an error as the default profile expects no values. To test it out place different files in the src/main/resources-local & src/main/resources-dev directories and see what appears in the target folder. <profiles> <!-- default PROFILE --> <!-- activation name !env forces local to run when no values supplied --> <!-- do NOT add a value to the local profile for !env --> <profile> <id>local-env</id> <activation> <property> <name>!env</name> </property> </activation> <properties> <resources.home>src/main/resources-local</resources.home> </properties> </profile> <profile> <id>dev-env</id> <activation> <property> <name>env</name> <value>dev</value> </property> </activation> <properties> <resources.home>src/main/resources-dev</resources.home> </properties> </profile> </profiles> ... <build> <resources> <resource> <directory>${resources.home}</directory> <includes> <include>**/*.properties</include> </includes> <targetPath>${resources.target}</targetPath> </resource> </resources> </build> Cheers, Jim -----Original Message----- From: Chris Helck [mailto:[EMAIL PROTECTED] Sent: Friday, June 15, 2007 1:59 PM To: Maven Users List Subject: RE: Profiles If you use activeByDefault then isn't the profile always active? I don't believe you can have a default profile that is active if and only if no other profile is active. If I'm wrong I'd love to know because I would find this very useful. Regards, Christopher -----Original Message----- From: Arnaud HERITIER [mailto:[EMAIL PROTECTED] Sent: Friday, June 15, 2007 2:02 PM To: Maven Users List Subject: Re: Profiles yes you have to set the activeByDefault to true http://maven.apache.org/ref/2.0.4/maven-settings/settings.html#class_act ivation Arnaud On 15/06/07, Jon Strayer <[EMAIL PROTECTED]> wrote: > > Is it possible to have a default profile that is activated only when > no other profile is activated? > > -- > Esse Quam Videre > To Be, rather than to Seem > -- .......................................................... Arnaud HERITIER .......................................................... OCTO Technology - [EMAIL PROTECTED] www.octo.com | blog.octo.com .......................................................... ASF - [EMAIL PROTECTED] www.apache.org | maven.apache.org ........................................................... ********************************************************************** This communication and all information (including, but not limited to, market prices/levels and data) contained therein (the "Information") is for informational purposes only, is confidential, may be legally privileged and is the intellectual property of ICAP plc and its affiliates ("ICAP") or third parties. No confidentiality or privilege is waived or lost by any mistransmission. The Information is not, and should not be construed as, an offer, bid or solicitation in relation to any financial instrument or as an official confirmation of any transaction. The Information is not warranted, including, but not limited, as to completeness, timeliness or accuracy and is subject to change without notice. ICAP assumes no liability for use or misuse of the Information. All representations and warranties are expressly disclaimed. The Information does not necessarily reflect the views of ICAP. Access to the Information by anyone else other than the recipient is unauthorized and any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it is prohibited. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. ********************************************************************** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]