@Override public String getUrl() { return userLocalArtifactRepository.getUrl(); }
/** * Checks the URL to see if this repository refers to an external repository * * @param originalRepository * @return true if external. */ static boolean isExternalRepo( ArtifactRepository originalRepository ) { try { URL url = new URL( originalRepository.getUrl() ); return !( url.getHost().equals( "localhost" ) || url.getHost().equals( "127.0.0.1" ) || url.getProtocol().equals( "file" ) ); } catch ( MalformedURLException e ) { // bad url just skip it here. It should have been validated already, but the wagon lookup will deal with it return false; } }
/** * Checks the URL to see if this repository refers to an external repository * * @param originalRepository * @return true if external. */ static boolean isExternalRepo( ArtifactRepository originalRepository ) { try { URL url = new URL( originalRepository.getUrl() ); return !( url.getHost().equals( "localhost" ) || url.getHost().equals( "127.0.0.1" ) || url.getProtocol().equals( "file" ) ); } catch ( MalformedURLException e ) { // bad url just skip it here. It should have been validated already, but the wagon lookup will deal with it return false; } }
sb.append( remoteRepository.getUrl() );
sb.append( remoteRepository.getUrl() );
String getRepositoryKey( ArtifactRepository repository ) { StringBuilder buffer = new StringBuilder( 256 ); Proxy proxy = repository.getProxy(); if ( proxy != null ) { if ( proxy.getUserName() != null ) { int hash = ( proxy.getUserName() + proxy.getPassword() ).hashCode(); buffer.append( hash ).append( '@' ); } buffer.append( proxy.getHost() ).append( ':' ).append( proxy.getPort() ).append( '>' ); } // 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() ); return buffer.toString(); }
createArtifactRepository( aliasedRepo.getId(), aliasedRepo.getUrl(), aliasedRepo.getLayout(), snapshotPolicy, releasePolicy );
createArtifactRepository( aliasedRepo.getId(), aliasedRepo.getUrl(), aliasedRepo.getLayout(), snapshotPolicy, releasePolicy );
private static boolean repositoryEquals( ArtifactRepository r1, ArtifactRepository r2 ) { if ( r1 == r2 ) { return true; } return eq( r1.getId(), r2.getId() ) && eq( r1.getUrl(), r2.getUrl() ) && repositoryPolicyEquals( r1.getReleases(), r2.getReleases() ) && repositoryPolicyEquals( r1.getSnapshots(), r2.getSnapshots() ); }
+ " for " + repository.getUrl() ); wagon.connect( new Repository( repository.getId(), repository.getUrl() ), authenticationInfo( repository ), proxyInfo( repository ) ); wagon.connect( new Repository( repository.getId(), repository.getUrl() ), authenticationInfo( repository ) ); wagon.connect( new Repository( repository.getId(), repository.getUrl() ), proxyInfo( repository ) ); wagon.connect( new Repository( repository.getId(), repository.getUrl() ) );
private void injectMirror( ArtifactRepository repository, Mirror mirror ) { if ( mirror != null ) { ArtifactRepository original = createArtifactRepository( repository.getId(), repository.getUrl(), repository.getLayout(), repository.getSnapshots(), repository.getReleases() ); repository.setMirroredRepositories( Collections.singletonList( original ) ); repository.setId( mirror.getId() ); repository.setUrl( mirror.getUrl() ); if ( StringUtils.isNotEmpty( mirror.getLayout() ) ) { repository.setLayout( getLayout( mirror.getLayout() ) ); } } }
private void injectMirror( ArtifactRepository repository, Mirror mirror ) { if ( mirror != null ) { ArtifactRepository original = createArtifactRepository( repository.getId(), repository.getUrl(), repository.getLayout(), repository.getSnapshots(), repository.getReleases() ); repository.setMirroredRepositories( Collections.singletonList( original ) ); repository.setId( mirror.getId() ); repository.setUrl( mirror.getUrl() ); if ( StringUtils.isNotEmpty( mirror.getLayout() ) ) { repository.setLayout( getLayout( mirror.getLayout() ) ); } } }
private org.apache.maven.settings.Proxy getProxy( ArtifactRepository repository, List<org.apache.maven.settings.Proxy> proxies ) { if ( proxies != null && repository.getProtocol() != null ) { for ( org.apache.maven.settings.Proxy proxy : proxies ) { if ( proxy.isActive() && repository.getProtocol().equalsIgnoreCase( proxy.getProtocol() ) ) { if ( StringUtils.isNotEmpty( proxy.getNonProxyHosts() ) ) { ProxyInfo pi = new ProxyInfo(); pi.setNonProxyHosts( proxy.getNonProxyHosts() ); org.apache.maven.wagon.repository.Repository repo = new org.apache.maven.wagon.repository.Repository( repository.getId(), repository.getUrl() ); if ( !ProxyUtils.validateNonProxyHosts( pi, repo.getHost() ) ) { return proxy; } } else { return proxy; } } } } return null; }
"Failure to resolve " + remotePath + " from " + repository.getUrl() + " was cached in the local repository. " + "Resolution will not be reattempted until the update interval of " "Failure to resolve " + remotePath + " from " + repository.getUrl() + " was cached in the local repository. " + "Resolution will not be reattempted until the update interval of "
public static RemoteRepository toRepo( ArtifactRepository repo ) { RemoteRepository result = null; if ( repo != null ) { RemoteRepository.Builder builder = new RemoteRepository.Builder( repo.getId(), getLayout( repo ), repo.getUrl() ); builder.setSnapshotPolicy( toPolicy( repo.getSnapshots() ) ); builder.setReleasePolicy( toPolicy( repo.getReleases() ) ); builder.setAuthentication( toAuthentication( repo.getAuthentication() ) ); builder.setProxy( toProxy( repo.getProxy() ) ); builder.setMirroredRepositories( toRepos( repo.getMirroredRepositories() ) ); result = builder.build(); } return result; }