[
https://jira.codehaus.org/browse/MNG-5643?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Robert Scholte updated MNG-5643:
--------------------------------
Description:
Profile properties in pom.xml don't override profile properties in settings.xml.
The goal is to provide team developers with a single settings.xml with useful
profiles. Then, each project will override profile properties if necessary.
In the following example we want to switch the $\{weblogic.host} property when
enabled in the IDE or from the command line via: mvn -P stage
What is curious is that overriding works when the profile being override exists
in the same place as the profile that is doing the overriding. What this means
is if all the profiles are in either the pom.xml OR settings.xml then
everything works as expected.
Normally, if the "stage" profile isn't actually present in the pom.xml I would
get this:
{noformat}[WARNING] The requested profile "stage" could not be activated
because it does not exist.{noformat}
But there is no warning about the profile "stage" because it does actually
existing. The "stage" profile does exist in the pom.xml!
Attached are sample pom.xml and settings.xml
The command:
{{mvn -P stage generate-resources}}
The current output is:
{noformat}
[INFO] --- maven-antrun-plugin:1.3:run (default) @ simple-web ---
[INFO] Executing tasks
[echo] WebLogic: localhost
[INFO] Executed tasks
{noformat}
The expected output is:
{noformat}
[INFO] --- maven-antrun-plugin:1.3:run (default) @ simple-web ---
[INFO] Executing tasks
[echo] WebLogic: 192.168.0.123
[INFO] Executed tasks
{noformat}
was:
Profile properties in pom.xml don't override profile properties in settings.xml.
The goal is to provide team developers with a single settings.xml with useful
profiles. Then, each project will override profile properties if necessary.
In the following example we want to switch the ${weblogic.host} property when
enabled in the IDE or from the command line via: mvn -P stage
What is curious is that overriding works when the profile being override exists
in the same place as the profile that is doing the overriding. What this means
is if all the profiles are in either the pom.xml OR settings.xml then
everything works as expected.
Normally, if the "stage" profile isn't actually present in the pom.xml I would
get this:
[WARNING] The requested profile "stage" could not be activated because it does
not exist.
But there is no warning about the profile "stage" because it does actually
existing. The "stage" profile does exist in the pom.xml!
Attached are sample pom.xml and settings.xml
The command:
mvn -P stage generate-resources
The current output is:
[INFO] --- maven-antrun-plugin:1.3:run (default) @ simple-web ---
[INFO] Executing tasks
[echo] WebLogic: localhost
[INFO] Executed tasks
The expected output is:
[INFO] --- maven-antrun-plugin:1.3:run (default) @ simple-web ---
[INFO] Executing tasks
[echo] WebLogic: 192.168.0.123
[INFO] Executed tasks
> Profile properties in pom.xml don't override profile properties in
> settings.xml
> -------------------------------------------------------------------------------
>
> Key: MNG-5643
> URL: https://jira.codehaus.org/browse/MNG-5643
> Project: Maven 2 & 3
> Issue Type: Bug
> Affects Versions: 3.2.1
> Reporter: Thomas Beauvais
> Attachments: pom.xml, settings.xml
>
>
> Profile properties in pom.xml don't override profile properties in
> settings.xml.
> The goal is to provide team developers with a single settings.xml with useful
> profiles. Then, each project will override profile properties if necessary.
> In the following example we want to switch the $\{weblogic.host} property
> when enabled in the IDE or from the command line via: mvn -P stage
> What is curious is that overriding works when the profile being override
> exists in the same place as the profile that is doing the overriding. What
> this means is if all the profiles are in either the pom.xml OR settings.xml
> then everything works as expected.
> Normally, if the "stage" profile isn't actually present in the pom.xml I
> would get this:
> {noformat}[WARNING] The requested profile "stage" could not be activated
> because it does not exist.{noformat}
> But there is no warning about the profile "stage" because it does actually
> existing. The "stage" profile does exist in the pom.xml!
> Attached are sample pom.xml and settings.xml
> The command:
> {{mvn -P stage generate-resources}}
> The current output is:
> {noformat}
> [INFO] --- maven-antrun-plugin:1.3:run (default) @ simple-web ---
> [INFO] Executing tasks
> [echo] WebLogic: localhost
> [INFO] Executed tasks
> {noformat}
> The expected output is:
> {noformat}
> [INFO] --- maven-antrun-plugin:1.3:run (default) @ simple-web ---
> [INFO] Executing tasks
> [echo] WebLogic: 192.168.0.123
> [INFO] Executed tasks
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)