@Override
        public void applyToConfigBuilder(SchemaGeneratorConfigBuilder builder) {
            SchemaRefDefinitionProvider definitionProvider = new SchemaRefDefinitionProvider(PACKAGE_FOR_EXTERNAL_REFS,
                    EXTERNAL_REF_PREFIX, EXTERNAL_REF_SUFFIX);
            builder.forTypesInGeneral()
                    .withCustomDefinitionProvider(definitionProvider)
                    .withIdResolver(scope -> definitionProvider.isMainType(scope.getType())
                            ? definitionProvider.getExternalRef(scope.getType()) : null);
        }
Wrapped as module with zero-parameter constructor for use via the Maven plugin.
jsonschema-examples/src/main/java/com/github/victools/jsonschema/examples/ExternalRefPackageExample.java