Instantiating a RepositoryHandler

I need to create a instance of a RepositoryHandler that is not tied to the project or buildscript objects. Is there (half-easy) way of using the Gradle API to do this?

The alternative for me is to implement the RepositoryHandler interface, but given the number of methods to implement, it will not be a trivial thing to do.

You may have a look at the real Gradle distribution sources :
or its inner class DefaultArtifactPublicationServices.class
or probably even better the default implementation of RepositoryHandler:

1 Like

Thank you Francois, even though it is an internal class, it looks like I can do some work with DefaultRepositoryHandler.