Refactor JpaComponentScanDetector to a more general use utility and ensure that details are always stored.