Re: Activate profile with property set in a file
Fri, 14 Oct 2011 09:35:26 +0200, /Jörg Schaible/: Any property used to activate a profile must be given on the command line or be defined in the settings.xml. Thanks. That confirms my suspicions. The point I want properties read from external file, but not settings.xml, is to maintain a configuration specific to a project. Using setting.xml for all projects could cause conflicts if two projects use the same named property for different purposes, or one just wants two projects configured differently. Having to always specify the properties on the command-line is not the best convenience, also. -- Stanimir - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Activate profile with property set in a file
You could use project specific settings.xml, using command line switch -s. Not sure if this fits your use case though. Am 15.10.2011 18:35 schrieb Stanimir Stamenkov s7a...@netscape.net: Fri, 14 Oct 2011 09:35:26 +0200, /Jörg Schaible/: Any property used to activate a profile must be given on the command line or be defined in the settings.xml. Thanks. That confirms my suspicions. The point I want properties read from external file, but not settings.xml, is to maintain a configuration specific to a project. Using setting.xml for all projects could cause conflicts if two projects use the same named property for different purposes, or one just wants two projects configured differently. Having to always specify the properties on the command-line is not the best convenience, also. -- Stanimir --**--**- To unsubscribe, e-mail: users-unsubscribe@maven.**apache.orgusers-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Activate profile with property set in a file
If you really have to do it a non maven way you can use the properties plugin .. On 11-10-15 10:45 AM, Ansgar Konermann wrote: You could use project specific settings.xml, using command line switch -s. Not sure if this fits your use case though. Am 15.10.2011 18:35 schrieb Stanimir Stamenkovs7a...@netscape.net: Fri, 14 Oct 2011 09:35:26 +0200, /Jörg Schaible/: Any property used to activate a profile must be given on the command line or be defined in the settings.xml. Thanks. That confirms my suspicions. The point I want properties read from external file, but not settings.xml, is to maintain a configuration specific to a project. Using setting.xml for all projects could cause conflicts if two projects use the same named property for different purposes, or one just wants two projects configured differently. Having to always specify the properties on the command-line is not the best convenience, also. -- Stanimir --**--**- To unsubscribe, e-mail: users-unsubscribe@maven.**apache.orgusers-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Activate profile with property set in a file
Manfred Moser wrote: If you really have to do it a non maven way you can use the properties plugin .. Maybe you start again with the beginning of the thread ... - Jörg - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Activate profile with property set in a file
Sat, 15 Oct 2011 19:45:25 +0200, /Ansgar Konermann/: Am 15.10.2011 18:35 schrieb Stanimir Stamenkov: The point I want properties read from external file, but not settings.xml, is to maintain a configuration specific to a project. Using setting.xml for all projects could cause conflicts if two projects use the same named property for different purposes, or one just wants two projects configured differently. Having to always specify the properties on the command-line is not the best convenience, also. You could use project specific settings.xml, using command line switch -s. Not sure if this fits your use case though. Thanks. I haven't realized it is possible. My ultimate goal is not having to specify anything more than 'mvn clean/compile/package/install' on the command-line, but if it's not otherwise possible specifying '-s settings.xml' additionally could be bearable. -- Stanimir - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Activate profile with property set in a file
Thanks. I haven't realized it is possible. My ultimate goal is not having to specify anything more than 'mvn clean/compile/package/install' on the command-line, but if it's not otherwise possible specifying '-s settings.xml' additionally could be bearable. Nothing stops you from altering mvn.bat and mvn.sh so that it looks for and uses settings.xml if one is in the same dir by activating -s in the batch/shell script. Then you could just type mvn compile etc. Wayne
Re: Activate profile with property set in a file
Hi, Stanimir Stamenkov wrote: [snip] with no luck. Does one have experience with using external properties file for the purposes of configuring the activation of profiles? [1] http://mojo.codehaus.org/properties-maven-plugin/ It does simply not work this way. One of the first things Maven does when reading a POM is to evaluate the profiles to setup the final project description. After that phase it starts the lifecycle where plugins might be called. So it is simply not possible to activate a profile based on a property set by a plugin. You may not even set a property in a profile of a parent pom and use that to activate a profile in a child. Any property used to activate a profile must be given on the command line or be defined in the settings.xml. - Jörg - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Activate profile with property set in a file
I'm trying to activate a build profile in a project, like: profiles profile idunpack/id activation property namedev.explode/name valueyes/value /property /activation build pluginManagement plugins ... /plugins /pluginManagement /build /profile /profiles Specifying the system property on the command-line like: mvn package -D dev.explode=yes seems to trigger the profile o.k. but I would like to have that configured in a build.properties file which gets read by the build. So I've tried the Properties Maven Plugin [1] by including it in the default build: plugin groupIdorg.codehaus.mojo/groupId artifactIdproperties-maven-plugin/artifactId version1.0-alpha-2/version executions execution phaseinitialize/phase goals goalread-project-properties/goal /goals configuration files filebuild.properties/file /files /configuration /execution /executions /plugin I didn't appear to have any effect and I've realized project and system properties might be different beasts, and trying to include the property like: properties dev.explodeyes/dev.explode /properties didn't change anything - the profile doesn't get activated. I've further tried moving the execution of the properties plugin to the validate phase, and using its set-system-properties goal: plugin groupIdorg.codehaus.mojo/groupId artifactIdproperties-maven-plugin/artifactId version1.0-alpha-2/version executions execution phasevalidate/phase goals goalset-system-properties/goal /goals configuration properties property namedev.explode/name valueyes/value /property /properties /configuration /execution /executions /plugin with no luck. Does one have experience with using external properties file for the purposes of configuring the activation of profiles? [1] http://mojo.codehaus.org/properties-maven-plugin/ -- Stanimir - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org