This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Activating 2 profiles in Maven Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Activating 2 profiles in Maven" Watch "Activating 2 profiles in Maven" New topic
Author

Activating 2 profiles in Maven

Rakesh Basani
Ranch Hand

Joined: Jun 04, 2012
Posts: 38
hi guys..

I am using profiles in pom.xml to connect to different databases by supplying values via properites files. So, If I activate 2 profiles at a time using <activateByDefault>true</activateByDefault>
then my application connects to which database. Please clarify my doubt.


Thanks in advance.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5852
    
    7

Property values are immutable, therefore the first property value that gets set wins. This will be the value set in the first profile in the pom.xml.


JBoss In Action
Rakesh Basani
Ranch Hand

Joined: Jun 04, 2012
Posts: 38
thank you very much for your peter..
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Activating 2 profiles in Maven
 
It's not a secret anymore!