you should be a to search for it

search
maven profile using environment variable

found
http://www.devx.com/Java/Article/32386/1763

good luck.

-D

On Mon, Sep 7, 2009 at 7:33 PM, James Russo<[email protected]> wrote:
> Hello,
>
>   In my ~/.m2/settings.xml I have:
>
> <settings>
>  <profiles>
>   <profile>
>     <id>setup_database_password</id>
>     <activation>
>       <activeByDefault>true</activeByDefault>
>     </activation>
>     <properties>
>       <environment.type>dev</environment.type>
>       <database.password>secret</database.password>
>     </properties>
>   </profile>
>  </profiles>
> </settings>
>
>
> So, this should set environment.type to "dev".
>
> Then in one of my sub-projects pom (beneath parent, not sure that matters
> though) I have this:
>
>       <profiles>
>               <profile>
>                       <id>setup_database_properties</id>
>                       <activation>
>     <property>
>         <name>environment.type</name>
>         <value>dev</value>
>       </property>
>
>                       </activation>
>                       <properties>
>
> <database.driverClassName>com.mysql.jdbc.Driver</database.driverClassName>
>
> <database.url>jdbc:postgresql://localhost/dbname</database.url>
>                               <database.user>dbuser</database.user>
>                       </properties>
>               </profile>
>       </profiles>
>
> However, when I run help:active-profiles I am only seeing the one profile
> (from ~/.m2/settings.xml) activated? I would expect that the profile in
> my pom.xml file would be activated since the environment value is set.
>
> If I specify -Denvironment.type=dev on the command line, it works as
> expected? If I change activation to !environment it works as well. Seems
> like it is just not
> picking up properties added by ~/.m2/settings.xml.
>
> thanks for any help or suggestions on how I might make this work. Obviously
> my goal is to simple keep database password out of svn and the project.
>
> -jr
>
> ---------------------------------------------------------------------
> 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]

Reply via email to