protected void updateRepositoryAuthentication()

in src/main/java/org/apache/maven/artifact/ant/AbstractArtifactTask.java [442:467]


    protected void updateRepositoryAuthentication(RemoteRepository repository) {
        if ( repository.getAuthentication() == null )
        {
            Server server = getSettings().getServer( repository.getId() );
            if ( server != null )
            {
                Authentication authentication = new Authentication( server );
                
                String password = authentication.getPassword();
                
                if (password != null) {
                    try {
                        SecDispatcher securityDispatcher = (SecDispatcher) container.lookup(SecDispatcher.ROLE);
                        password = securityDispatcher.decrypt(password);
                        authentication.setPassword(password);
                    } catch (SecDispatcherException e) {
                        log(e, Project.MSG_ERR);
                    } catch (ComponentLookupException e) {
                        log(e, Project.MSG_ERR);
                    }
                }
                
                repository.addAuthentication( authentication );
            }
        }
    }