throws ArtifactInstallationException
{
RepositorySystemSession session =
LegacyLocalRepositoryManager.overlay( localRepository, legacySupport.getRepositorySession(), repoSystem );
InstallRequest request = new InstallRequest();
request.setTrace( RequestTrace.newChild( null, legacySupport.getSession().getCurrentProject() ) );
org.eclipse.aether.artifact.Artifact mainArtifact = RepositoryUtils.toArtifact( artifact );
mainArtifact = mainArtifact.setFile( source );
request.addArtifact( mainArtifact );
for ( ArtifactMetadata metadata : artifact.getMetadataList() )
{
if ( metadata instanceof ProjectArtifactMetadata )
{
org.eclipse.aether.artifact.Artifact pomArtifact = new SubArtifact( mainArtifact, "", "pom" );
pomArtifact = pomArtifact.setFile( ( (ProjectArtifactMetadata) metadata ).getFile() );
request.addArtifact( pomArtifact );
}
else if ( metadata instanceof SnapshotArtifactRepositoryMetadata
|| metadata instanceof ArtifactRepositoryMetadata )
{
// eaten, handled by repo system
}
else
{
request.addMetadata( new MetadataBridge( metadata ) );
}
}
try
{