builder.setProxy( session.getProxySelector().getProxy( remoteRepo ) );
remoteRepo = builder.build();
}
request.setRepository( remoteRepo );
DeployResult result;
try
{
result = repoSystem.deploy( session, request );
}
catch ( DeploymentException e )
{
throw new ArtifactDeploymentException( e.getMessage(), e );
}
for ( Object metadata : result.getMetadata() )
{
if ( metadata.getClass().getName().endsWith( ".internal.VersionsMetadata" ) )
{
relatedMetadata.put( versionKey, (MergeableMetadata) metadata );
}
if ( snapshotKey != null && metadata.getClass().getName().endsWith( ".internal.RemoteSnapshotMetadata" ) )
{
relatedMetadata.put( snapshotKey, (MergeableMetadata) metadata );
}
}
artifact.setResolvedVersion( result.getArtifacts().iterator().next().getVersion() );
}