maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Benedict (JIRA)" <j...@apache.org>
Subject [jira] [Created] (MPH-152) Enhance console output of "evaluate" goal to indicate result
Date Wed, 06 Jun 2018 17:52:00 GMT
Paul Benedict created MPH-152:
---------------------------------

             Summary: Enhance console output of "evaluate" goal to indicate result
                 Key: MPH-152
                 URL: https://issues.apache.org/jira/browse/MPH-152
             Project: Maven Help Plugin
          Issue Type: Improvement
          Components: evaluate
    Affects Versions: 3.0.1
            Reporter: Paul Benedict


I have two requirements for consideration:
 # Scripts should be able to easily get the resolution status.
 # 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:
{code:none}
> mvn help:evaluate -Dexpression=settings.localRepository -Doutput=out.txt
[INFO] Scanning for projects...
. . .
[INFO] Result of evaluation written to: c:\proj\out.txt{code}
Can you consider something similar for the console?

Example possible solutions:
{code:none}
> mvn help:evaluate -Dexpression=settings.localRepository
[INFO] Scanning for projects...
. . .
[INFO] Result of evaluation: /home/joeuser/.m2/repository{code}
And again:
{code:none}
> mvn help:evaluate -Dexpression=zzz
[INFO] Scanning for projects...
. . .
[INFO] Result of evaluation: null{code}
PS: If you think current behavior should be preserved, a new plugin option can be introduced.
However, as [shown by this link|https://stackoverflow.com/questions/5916157/how-to-get-the-maven-local-repo-location],
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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message