public void execute(Upload upload) {
// todo : unfortunately I have no idea how to apply this to non MavenDeployer-type repos...
upload.getRepositories().withType( MavenDeployer.class ).all(
new Action<MavenDeployer>() {
public void execute(MavenDeployer deployer) {
final RemoteRepository repository = deployer.getRepository();
if ( repository != null ) {
final Authentication authentication = locateAuthenticationDetails( repository );
if ( authentication != null ) {
repository.addAuthentication( authentication );
}
}
final RemoteRepository snapshotRepository = deployer.getSnapshotRepository();
if ( snapshotRepository != null ) {
final Authentication authentication = locateAuthenticationDetails( snapshotRepository );
if ( authentication != null ) {
snapshotRepository.addAuthentication( authentication );
}
}
}
}
);