jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2 & 3
  • MNG-3884

Command line arguments don't overwrite settings.xml properties when invoking a plugin

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 2.0.9, 2.1.0-M1
  • Fix Version/s: None
  • Component/s: Command Line
  • Labels:
    None
  • Environment:
    All environments
  • Complexity:
    Intermediate

Description

To explain the issue, let's start with the following example:

1°) Run a plugin goal with an argument specified in the command line with the "-D" option only

mvn eclipse:eclipse -Declipse.projectNameTemplate=CommandLineProjectName

We can see if we open the generated .project file that the name of the project is as we expect: "CommandLineProjectName"
This is normal, the goal input parameter is set with the command line property.

2°) Run a plugin goal with an argument specified in the "settings.xml" file only

mvn eclipse:eclipse

with settings.xml containing the following enabled profile:

<profiles>
<profile>
<id>testProfile</id>
<properties>
<eclipse.projectNameTemplate>SettingsProjectName</eclipse.projectNameTemplate>
</properties>
</profile>
</profiles>

<activeProfiles>
<activeProfile>testProfile</activeProfile>
</activeProfiles>

We can see if we open the generated .project file that the name of the project is as we expect: "SettingsProjectName".
This is normal, the input parameter of the goal is set with the "settings.xml" file property.

3°) Run a plugin goal with an argument specified in the command line with the "-D" option and with another value in the "settngs.xml" file

If we use both scenarios, the property value set in the "settings.xml" file will overwrite the value set via the command line with the "-D" option.
Maven should not react in that way but in the opposite: the command line value should overwite the "settings.xml" file value.

It is already the case if we reuse the value somewhere in the pom.xml file. It should be the same when invoking a plugin goal.

Issue Links

duplicates

Bug - A problem which impairs or prevents the functions of the product. MNG-1992 CLI -D should override properties in settings.xml

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
laurent gousenbourger added a comment - 01/Dec/08 5:27 PM

The goal of that approach is to have default values configured in a profile of the settings.xml file.

If we invoke different in-house plugins, the default values will be used.

In special case, we would like to overwrite this default values by specifying them with the command line with thee "-D" option.
In that case, the "-D" option should have the last word!

Show
laurent gousenbourger added a comment - 01/Dec/08 5:27 PM The goal of that approach is to have default values configured in a profile of the settings.xml file. If we invoke different in-house plugins, the default values will be used. In special case, we would like to overwrite this default values by specifying them with the command line with thee "-D" option. In that case, the "-D" option should have the last word!

People

  • Assignee:
    Benjamin Bentmann
    Reporter:
    laurent gousenbourger
Vote (1)
Watch (1)

Dates

  • Created:
    01/Dec/08 5:23 PM
    Updated:
    28/Mar/10 5:36 PM
    Resolved:
    28/Mar/10 5:36 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.