use of org.apache.maven.wagon.WagonException in project intellij-community by JetBrains.
the class Maven3ServerIndexFetcher method connect.
@Override
public void connect(String _ignoredContextId, String _ignoredUrl) throws IOException {
ArtifactRepository artifactRepository = myRepositorySystem.createArtifactRepository(myOriginalRepositoryId, myOriginalRepositoryUrl, null, null, null);
final ArtifactRepository mirrorRepository = myWagonManager.getMirrorRepository(artifactRepository);
String mirrorUrl = mirrorRepository.getUrl();
String indexUrl = mirrorUrl + (mirrorUrl.endsWith("/") ? "" : "/") + ".index";
Repository repository = new Repository(myOriginalRepositoryId, indexUrl);
try {
myWagon = myWagonManager.getWagon(repository);
myWagon.addTransferListener(myListener);
myWagon.connect(repository, myWagonManager.getAuthenticationInfo(mirrorRepository.getId()), myWagonManager.getProxy(mirrorRepository.getProtocol()));
} catch (AuthenticationException e) {
IOException newEx = new IOException("Authentication exception connecting to " + repository);
newEx.initCause(e);
throw newEx;
} catch (WagonException e) {
IOException newEx = new IOException("Wagon exception connecting to " + repository);
newEx.initCause(e);
throw newEx;
}
}
use of org.apache.maven.wagon.WagonException in project intellij-community by JetBrains.
the class Maven2ServerIndexFetcher method connect.
public void connect(String _ignoredContextId, String _ignoredUrl) throws IOException {
final ArtifactRepository mirrorRepository = myWagonManager.getMirrorRepository(new DefaultArtifactRepository(myOriginalRepositoryId, myOriginalRepositoryUrl, null));
String mirrorUrl = mirrorRepository.getUrl();
String indexUrl = mirrorUrl + (mirrorUrl.endsWith("/") ? "" : "/") + ".index";
Repository repository = new Repository(myOriginalRepositoryId, indexUrl);
try {
myWagon = myWagonManager.getWagon(repository);
myWagon.addTransferListener(myListener);
myWagon.connect(repository, myWagonManager.getAuthenticationInfo(mirrorRepository.getId()), myWagonManager.getProxy(mirrorRepository.getProtocol()));
} catch (AuthenticationException e) {
IOException newEx = new IOException("Authentication exception connecting to " + repository);
newEx.initCause(e);
throw newEx;
} catch (WagonException e) {
IOException newEx = new IOException("Wagon exception connecting to " + repository);
newEx.initCause(e);
throw newEx;
}
}
use of org.apache.maven.wagon.WagonException in project maven-plugins by apache.
the class CopyRepositoryMojo method execute.
public void execute() throws MojoExecutionException {
try {
Repository sourceRepository = new Repository(sourceRepositoryId, source);
Repository targetRepository = new Repository(targetRepositoryId, target);
copier.copy(sourceRepository, targetRepository, version);
} catch (IOException e) {
throw new MojoExecutionException("Error copying repository from " + source + " to " + target, e);
} catch (WagonException e) {
throw new MojoExecutionException("Error copying repository from " + source + " to " + target, e);
}
}
Aggregations