class DefaultRepositoryFactory implements RepositoryFactory {

    @Override
    public LocalRepository createLocal(Path path) {
        return new DefaultLocalRepository(new org.eclipse.aether.repository.LocalRepository(path.toFile()));
    }

    @Override
    public RemoteRepository createRemote(String id, String url) {
        return new DefaultRemoteRepository(
                new org.eclipse.aether.repository.RemoteRepository.Builder(id, "default", url).build());
    }

    @Override
    public RemoteRepository createRemote(Repository repository) throws IllegalArgumentException {
        return new DefaultRemoteRepository(new org.eclipse.aether.repository.RemoteRepository.Builder(
                        repository.getId(), repository.getLayout(), repository.getUrl())
                .setReleasePolicy(buildRepositoryPolicy(repository.getReleases()))
                .setSnapshotPolicy(buildRepositoryPolicy(repository.getSnapshots()))
                .build());
    }

    public static org.eclipse.aether.repository.RepositoryPolicy buildRepositoryPolicy(
            org.apache.maven.api.model.RepositoryPolicy policy) {<FILL_FUNCTION_BODY>}
}

        boolean enabled = true;
        String updatePolicy = RepositoryPolicy.UPDATE_POLICY_DAILY;
        String checksumPolicy = RepositoryPolicy.CHECKSUM_POLICY_FAIL;
        if (policy != null) {
            enabled = policy.isEnabled();
            if (policy.getUpdatePolicy() != null) {
                updatePolicy = policy.getUpdatePolicy();
            }
            if (policy.getChecksumPolicy() != null) {
                checksumPolicy = policy.getChecksumPolicy();
            }
        }
        return new org.eclipse.aether.repository.RepositoryPolicy(enabled, updatePolicy, checksumPolicy);
    
<no_super_class>