Uploaded image for project: 'Maven Help Plugin'
  1. Maven Help Plugin
  2. MPH-152

Enhance console output of "evaluate" goal to indicate result

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Resolved
    • 3.0.1
    • None
    • evaluate
    • None

    Description

      I have two requirements for consideration:

      1. Scripts should be able to easily get the resolution status.
      2. Scripts should be able to easily get the resolved expression value.

      When evaluating an expression, the output does not have a good marker to help scripts identity the resolution. Current plugin behavior prints the value (practically buried among Maven's logging) or "null object or invalid expression" message.

      The -o option could be used, of course, but file creation is more overhead than necessary. But what is good about the -o option is that it prints a clear marker:

      > mvn help:evaluate -Dexpression=settings.localRepository -Doutput=out.txt
      [INFO] Scanning for projects...
      . . .
      [INFO] Result of evaluation written to: c:\proj\out.txt

      Can you consider something similar for the console?

      Example possible solutions:

      > mvn help:evaluate -Dexpression=settings.localRepository
      [INFO] Scanning for projects...
      . . .
      [INFO] Result of evaluation: /home/joeuser/.m2/repository

      And again:

      > mvn help:evaluate -Dexpression=zzz
      [INFO] Scanning for projects...
      . . .
      [INFO] Result of evaluation: null

      PS: If you think current behavior should be preserved, a new plugin option can be introduced. However, as shown by this link, I think people have a difficult time clobbering together an answer to parse reliably. There are other examples on that site if you're interested. So I don't think any effort should be taken with introducing a new option. Just my 2 cents. Since the fragility already exists, just provide an "official" solution to remediate it.

      Thank you.

      Attachments

        Issue Links

          Activity

            People

              rfscholte Robert Scholte
              pbenedict Paul Benedict
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: