Bence Sipka created MRESOLVER-95:
------------------------------------

             Summary: 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


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)

Reply via email to