Details

    • Type: Wish Wish
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1.1
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      Description

      The help:evaluate goal is designed to be called in interactive mode.
      I would like to call this goal in batch mode, passing the expression to evaluate in a property (on the command line).

      The final purpose is to evaluate predefined expressions inside a script
      (unfortunately, the script is a batch file in my case...)

        Activity

        Hide
        Costin Caraivan added a comment -

        This would definitely be useful when integrating Maven with other systems. This way these systems can extract information from Maven, in a controlled manner. Otherwise the pom must be parsed, which can lead to all sorts of nasty things

        Show
        Costin Caraivan added a comment - This would definitely be useful when integrating Maven with other systems. This way these systems can extract information from Maven, in a controlled manner. Otherwise the pom must be parsed, which can lead to all sorts of nasty things
        Hide
        Galak added a comment -

        Moreover: when I want to evaluate a property which is inherited from a parent pom, parsing the project pom is inefficient...
        And I do not want to reproduce the Maven pom inheritance system

        Show
        Galak added a comment - Moreover: when I want to evaluate a property which is inherited from a parent pom, parsing the project pom is inefficient... And I do not want to reproduce the Maven pom inheritance system
        Hide
        Jon Lorusso added a comment -

        I concur with previous comments.

        I need a way to do something like this:

        mvn help:evaluate -Dexpression=project.version

        So that I can get at the pom's version, without (as has been said above) parsing the pom myself. I am fairly surprised this type of functionality does not exist in this or any other of the many many plugins out there.

        Show
        Jon Lorusso added a comment - I concur with previous comments. I need a way to do something like this: mvn help:evaluate -Dexpression=project.version So that I can get at the pom's version, without (as has been said above) parsing the pom myself. I am fairly surprised this type of functionality does not exist in this or any other of the many many plugins out there.
        Hide
        Brett Porter added a comment -

        Note that you must omit the $

        {...} on the expression as Maven would recursively resolve it for you. While we probably could have just output that as the value it seemed more risky to me, and it is also difficult to escape those in a shell environment, so we instead go through the normal resolution of the expression after surrounding the parameter with ${...}

        .

        Show
        Brett Porter added a comment - Note that you must omit the $ {...} on the expression as Maven would recursively resolve it for you. While we probably could have just output that as the value it seemed more risky to me, and it is also difficult to escape those in a shell environment, so we instead go through the normal resolution of the expression after surrounding the parameter with ${...} .

          People

          • Assignee:
            Brett Porter
            Reporter:
            Galak
          • Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: