You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Giovds (via GitHub)" <gi...@apache.org> on 2023/04/13 15:13:34 UTC

[GitHub] [maven] Giovds opened a new pull request, #1087: [MNG-6934] Suggest plugin upgrade in case of failure

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/
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] Giovds commented on pull request #1087: [MNG-6934] Suggest plugin upgrade in case of failure

Posted by "Giovds (via GitHub)" <gi...@apache.org>.
Giovds commented on PR #1087:
URL: https://github.com/apache/maven/pull/1087#issuecomment-1541587954

   I don't think there are unnecessary connections as they are required to check if the plugin is using the latest version _if the Jira ticket is still something Maven wants to provide_. I don't think you can resolve this issue within Maven without outbound connections?
   
   An alternative could be to check only the local repository, but I don't think this is a good idea as the user may or may not have higher versions of the plugin installed.
   
   Or it could just log a suggestion like: "Please consider checking you are using the latest version of the 'xxx' plugin", however that kind of defeats the purpose of automatically checking for newer version.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] cstamas commented on pull request #1087: [MNG-6934] Suggest plugin upgrade in case of failure

Posted by "cstamas (via GitHub)" <gi...@apache.org>.
cstamas commented on PR #1087:
URL: https://github.com/apache/maven/pull/1087#issuecomment-1541595300

   This is -1 from me: Maven in case of failure to go remote and look for new plugin version?
   
   I'd simply emit message (for ASF plugins) that points user to this page: https://maven.apache.org/plugins/ and for non-ASF plugins with meaningful message like "please do you use latest version of this plugin". Maybe even mention this Mojo/page https://www.mojohaus.org/versions/versions-maven-plugin/display-plugin-updates-mojo.html
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] Giovds closed pull request #1087: [MNG-6934] Suggest plugin upgrade in case of failure

Posted by "Giovds (via GitHub)" <gi...@apache.org>.
Giovds closed pull request #1087: [MNG-6934] Suggest plugin upgrade in case of failure
URL: https://github.com/apache/maven/pull/1087


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [maven] Giovds commented on pull request #1087: [MNG-6934] Suggest plugin upgrade in case of failure

Posted by "Giovds (via GitHub)" <gi...@apache.org>.
Giovds commented on PR #1087:
URL: https://github.com/apache/maven/pull/1087#issuecomment-1570005110

   Closing PR as discussed in ticket and here. We don't see a correct way to be absolutely sure an upgrade will result in resolving the issue, and you can not depend on the exceptions thrown by the plugins.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org