Collection<String> projectVersions = getVersions( selectedRepos, groupId, artifactId );
repositorySession = repositorySessionFactory.createSession();
MetadataResolver metadataResolver = repositorySession.getResolver();
ProjectVersionMetadata sharedModel = new ProjectVersionMetadata();
MavenProjectFacet mavenFacet = new MavenProjectFacet();
mavenFacet.setGroupId( groupId );
mavenFacet.setArtifactId( artifactId );
sharedModel.addFacet( mavenFacet );
boolean isFirstVersion = true;
for ( String version : projectVersions )
{
ProjectVersionMetadata versionMetadata = null;
for ( String repoId : selectedRepos )
{
if ( versionMetadata == null || versionMetadata.isIncomplete() )
{
try
{
versionMetadata =
metadataResolver.resolveProjectVersion( repositorySession, repoId, groupId, artifactId,
version );
}
catch ( MetadataResolutionException e )
{
log.error( "Skipping invalid metadata while compiling shared model for " + groupId + ":"