You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2020/12/24 13:21:00 UTC

[jira] [Commented] (MRESOLVER-95) Allow extending ChecksumPolicyProvider

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

Michael Osipov commented on MRESOLVER-95:
-----------------------------------------

Still waiting for a feedback on this.

> Allow extending ChecksumPolicyProvider
> --------------------------------------
>
>                 Key: MRESOLVER-95
>                 URL: https://issues.apache.org/jira/browse/MRESOLVER-95
>             Project: Maven Resolver
>          Issue Type: Improvement
>          Components: Resolver
>    Affects Versions: 1.4.1
>            Reporter: Bence Sipka
>            Priority: Minor
>             Fix For: waiting-for-feedback
>
>
> The ChecksumPolicyProvider interface is used to create the ChecksumPolicy objects that define the behaviour to take in case of mismatching artifact checksums. The ChecksumPolicyProvider class is documented as
> {code:java}
> @noimplement This interface is not intended to be implemented by clients.
> @noextend This interface is not intended to be extended by clients.{code}
> Please allow the extending and implementing this interface.
> Justification:
> The ChecksumPolicy interface is already implementable, as that doesn't declare the above prohibition. However, the only implementation of ChecksumPolicyProvider is DefaultChecksumPolicyProvider, that is a final class, therefore doesn't allow customization of the checksum policies. This makes the implementability of ChecksumPolicy void, as we cannot inject our checksum policy implementations into the maven resolver system, as the documentation prohibits it.
> Use-case:
> I'd like to use my own ChecksumPolicy that handles the ignore, warn, and error cases and logs the errors into my custom output. The AbstractChecksumPolicy superclass for the current implementations will always use a Logger instance, however that is not usable in my environment.
> In order to solve this, I'd like to be able to implement my own ChecksumPolicyProvider that creates my custom ChecksumPolicy that logs the errors and warnings to a custom location instead of using the Logger that comes with AbstractChecksumPolicy .
> Solution:
> Remove the prohibition from the documentation of ChecksumPolicyProvider.
> Workaround:
> Implement ChecksumPolicyProvider nonetheless.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)