@Override
public String getPathForLocalMetadata( ProjectBuildingRequest buildingRequest, ArtifactMetadata metadata )
{
Metadata aetherMetadata =
new DefaultMetadata( metadata.getGroupId(),
metadata.storedInGroupDirectory() ? null : metadata.getArtifactId(),
metadata.storedInArtifactVersionDirectory() ? metadata.getBaseVersion() : null,
"maven-metadata.xml", Nature.RELEASE_OR_SNAPSHOT );
RepositorySystemSession session;
try
{
session = (RepositorySystemSession) Invoker.invoke( buildingRequest, "getRepositorySession" );
}
catch ( RepositoryManagerException e )
{
throw new RuntimeException( e.getMessage(), e );
}
return session.getLocalRepositoryManager().getPathForLocalMetadata( aetherMetadata );
}