for ( String repoId : observableRepos )
{
// slight behaviour change to previous implementation: instead of allocating "jar" when not
// found in the database, we can rely on the metadata repository to create it on the fly. We
// just allocate the default packaging if the Maven facet is not found.
FacetedMetadata model = metadataResolver.resolveProjectVersion( repositorySession, repoId,
resultHit.getGroupId(),
resultHit.getArtifactId(),
version );
if ( model != null )
{
String packaging = "jar";
MavenProjectFacet facet = (MavenProjectFacet) model.getFacet(
MavenProjectFacet.FACET_ID );
if ( facet != null && facet.getPackaging() != null )
{
packaging = facet.getPackaging();
}