Package org.apache.maven.artifact.repository

Examples of org.apache.maven.artifact.repository.Authentication


    String getRepositoryKey( ArtifactRepository repository )
    {
        StringBuilder buffer = new StringBuilder( 256 );

        // consider the username&password because a repo manager might block artifacts depending on authorization
        Authentication auth = repository.getAuthentication();
        if ( auth != null )
        {
            int hash = ( auth.getUsername() + auth.getPassword() ).hashCode();
            buffer.append( hash ).append( '@' );
        }

        // consider the URL (instead of the id) as this most closely relates to the contents in the repo
        buffer.append( repository.getUrl() );
View Full Code Here


                                "Offline mode, using local cache only for repository " + repository.getId() + " ("
                                        + repository.getUrl() + ")");
                    }

                    try {
                        Authentication auth = repository.getAuthentication();
                        if (auth != null) {
                            resolver.setCredentials(uri, auth.getUsername(), auth.getPassword());
                        }

                        resolver.addP2Repository(uri);

                        getLogger().debug(
View Full Code Here

                                "Offline mode, using local cache only for repository " + repository.getId() + " ("
                                        + repository.getUrl() + ")");
                    }

                    try {
                        Authentication auth = repository.getAuthentication();
                        if (auth != null) {
                            resolutionContext.setCredentials(uri, auth.getUsername(), auth.getPassword());
                        }

                        resolutionContext.addP2Repository(uri);

                        getLogger().debug(
View Full Code Here

                        {
                            logger.debug( problem.getMessage(), problem.getException() );
                        }
                    }

                    Authentication authentication = new Authentication( server.getUsername(), server.getPassword() );
                    authentication.setPrivateKey( server.getPrivateKey() );
                    authentication.setPassphrase( server.getPassphrase() );

                    repository.setAuthentication( authentication );
                }
                else
                {
View Full Code Here

            {
                org.sonatype.aether.repository.Authentication auth =
                    selector.getAuthentication( RepositoryUtils.toRepo( repository ) );
                if ( auth != null )
                {
                    Authentication result = new Authentication( auth.getUsername(), auth.getPassword() );
                    result.setPrivateKey( auth.getPrivateKeyFile() );
                    result.setPassphrase( auth.getPassphrase() );
                    return result;
                }
            }
        }
        return null;
View Full Code Here

        DefaultRepositoryLayout layout = new DefaultRepositoryLayout();
        ArtifactRepository repo = new DefaultArtifactRepository(serverId, uri, layout);
        if (newUserAdded) {
            // make sure to set authentication if we just added new user
            repo.setAuthentication(new Authentication(fabricServer.getUsername(), fabricServer.getPassword()));
        }

        // Deploy the POM
        boolean isPomArtifact = "pom".equals(packaging);
        if (!isPomArtifact) {
View Full Code Here

                        {
                            logger.debug( problem.getMessage(), problem.getException() );
                        }
                    }

                    Authentication authentication = new Authentication( server.getUsername(), server.getPassword() );

                    repository.setAuthentication( authentication );
                }
                else
                {
View Full Code Here

TOP

Related Classes of org.apache.maven.artifact.repository.Authentication

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.