private void configureUploadTasks(final DefaultDeployerFactory deployerFactory) {
project.getTasks().withType(Upload.class, new Action<Upload>() {
public void execute(Upload upload) {
RepositoryHandler repositories = upload.getRepositories();
DefaultRepositoryHandler handler = (DefaultRepositoryHandler) repositories;
DefaultMavenRepositoryHandlerConvention repositoryConvention = new DefaultMavenRepositoryHandlerConvention(handler, deployerFactory);
new DslObject(repositories).getConvention().getPlugins().put("maven", repositoryConvention);
}
});
}