ok, a couple of things:
First I'm not sure you need to be writing code to enable npm- and repository-based validation: both are available via configuration.
To enable repository validation, set this application.yaml property:
hapi.fhir.enable_repository_validating_interceptor: true
To store and install a custom profile (e.g., hl7-france-fhir.administrative-11.2021.1.tgz), set these properties:
hapi:
fhir:
implementationguides:
france-fhir-admin:
url: classpath:Package/hl7-france-fhir.administrative-11.2021.1.tgz
name: <look in package.json>
version: <look in package.json>
The profile will load on server startup, store package artifacts in both binary and fhir resource representations, and should be available for meta.profile referencing.
Let me know if you have any questions, it does not work for you, etc.
Paul