protected < T extends MavenProjectDescriptor > T resolveProject ( MavenProject project , Class < T > expectedType , ScannerContext scannerContext ) { Store store = scannerContext . getStore ( ) ; String id = project . getGroupId ( ) + ":" + project . getArtifactId ( ) + ":" + project . getVersion ( ) ; MavenProjectDescriptor projectDescriptor = store . find ( MavenProjectDescriptor . class , id ) ; if ( projectDescriptor == null ) { projectDescriptor = store . create ( expectedType , id ) ; projectDescriptor . setName ( project . getName ( ) ) ; projectDescriptor . setGroupId ( project . getGroupId ( ) ) ; projectDescriptor . setArtifactId ( project . getArtifactId ( ) ) ; projectDescriptor . setVersion ( project . getVersion ( ) ) ; projectDescriptor . setPackaging ( project . getPackaging ( ) ) ; projectDescriptor . setFullQualifiedName ( id ) ; } else if ( ! expectedType . isAssignableFrom ( projectDescriptor . getClass ( ) ) ) { projectDescriptor = store . addDescriptorType ( projectDescriptor , expectedType ) ; } return expectedType . cast ( projectDescriptor ) ; }
Resolves a maven project .