[ 
https://issues.apache.org/jira/browse/MNG-6934?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17711939#comment-17711939
 ] 

ASF GitHub Bot commented on MNG-6934:
-------------------------------------

Giovds opened a new pull request, #1087:
URL: https://github.com/apache/maven/pull/1087

   
![image](https://user-images.githubusercontent.com/27761321/231780319-a2da8b0a-93a7-4f6b-a755-638059eedfa6.png)
   (Locally installed multiple versions of a dummy plugin, version 
2.0.0-SNAPSHOT just throws an exception)
   
   I'm not sure if this is the correct approach to this issue and I would like 
to hear your thoughts.
   
   1. I'm currently checking `MojoExecutionException` as trigger to check if 
there are newer plugin versions available, but I'm unaware of alternatives to 
this. I've tried the `AbstractMojoExecutionException` to catch 
`MojoFailureException` as well, however this will also trigger the check for 
test failures for example which seems an unlikely case of wanting to upgrade 
the test plugin.
   
       [These 
docs](https://maven.apache.org/developers/mojo-api-specification.html#org-apache-maven-plugin-mojo)
 lead me to believe the `MojoExecutionException` is something the plugin can 
not recover from, which makes me think this is a case of perhaps upgrading your 
plugin. Or perhaps I should enrich via the `PluginManagerException` or [once 
any exception comes out of the 
mojo.execute()](https://github.com/apache/maven/blob/b7a3d857136ec89bdfe35aea05ed2746f09de162/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java#L341).
 I'm not sure if these are correct assumptions.
       
       Perhaps any uncaught exceptions should be caught and rethrown while 
adding some metadata/new exception to identify it in the ExceptionHandler?
       
       Trying to filter a blacklist of plugins that should not to be checked in 
some in-memory list doesn't seem like a better approach.
   
   2. It would be nice to fill the reference with some sort of link to the 
plugin or the version that is suggested. So that the user can see `-> [Help X]` 
and `[Help x] http://link-to-plugin-or-version`. I can't find one in the 
`PluginDescriptor` or similar classes through the `MavenPluginManager` and 
`PluginResolver` classes. Perhaps there is another way of retrieving this?
   ---
   Following this checklist to help us incorporate your
   contribution quickly and easily:
   
    - [x] Make sure there is a 
[MNG-6934](https://issues.apache.org/jira/browse/MNG-6934) filed
          for the change (usually before you start working on it).  Trivial 
changes like typos do not
          require a JIRA issue. Your pull request should address just this 
issue, without
          pulling in other changes.
    - [x] Each commit in the pull request should have a meaningful subject line 
and body.
    - [x] Format the pull request title like `[MNG-XXX] SUMMARY`,
          where you replace `MNG-XXX` and `SUMMARY` with the appropriate JIRA 
issue.
    - [x] Also format the first line of the commit message like `[MNG-XXX] 
SUMMARY`.
          Best practice is to use the JIRA issue title in both the pull request 
title and in the first line of the commit message.
    - [x] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
    - [x] Run `mvn clean verify` to make sure basic checks pass. A more 
thorough check will
          be performed on your pull request automatically.
    - [ ] You have run the [Core IT][core-its] successfully.
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License 
Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under
   the [Apache License Version 2.0, January 
2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
    - [x] I hereby declare this contribution to be licenced under the [Apache 
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
    - [x] In any other case, please file an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   [core-its]: https://maven.apache.org/core-its/core-it-suite/
   




> Suggest plugin upgrade in case of failure
> -----------------------------------------
>
>                 Key: MNG-6934
>                 URL: https://issues.apache.org/jira/browse/MNG-6934
>             Project: Maven
>          Issue Type: Improvement
>            Reporter: Robert Scholte
>            Priority: Major
>
> In case a plugin fails, Maven should look if there is a more recent version.
> It is considered the best practice to verify the most recent version first 
> before issueing a but, as it might already be solved.
> The be clear: if the most recent plugin is used, this message should not be 
> shown.
> Make use of the metadata to get the most recent version.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to