public ModelSource resolveModel ( Parent parent ) throws UnresolvableModelException { Dependency parentDependency = new Dependency ( ) ; parentDependency . setGroupId ( parent . getGroupId ( ) ) ; parentDependency . setArtifactId ( parent . getArtifactId ( ) ) ; parentDependency . setVersion ( parent . getVersion ( ) ) ; parentDependency . setClassifier ( "" ) ; parentDependency . setType ( "pom" ) ; Artifact parentArtifact = null ; try { Iterable < ArtifactResult > artifactResults = depencencyResolver . resolveDependencies ( projectBuildingRequest , singleton ( parentDependency ) , null , null ) ; Iterator < ArtifactResult > iterator = artifactResults . iterator ( ) ; if ( iterator . hasNext ( ) ) { parentArtifact = iterator . next ( ) . getArtifact ( ) ; } } catch ( DependencyResolverException e ) { throw new UnresolvableModelException ( e . getMessage ( ) , parent . getGroupId ( ) , parent . getArtifactId ( ) , parent . getVersion ( ) , e ) ; } return resolveModel ( parentArtifact . getGroupId ( ) , parentArtifact . getArtifactId ( ) , parentArtifact . getVersion ( ) ) ; }
Resolves the POM for the specified parent .