private void executePom(File pomFile) throws Exception {
        // Get the maven pom file content
        Xpp3Dom pomDom;
        PlexusConfiguration configuration;
        try (FileReader pomReader = new FileReader(pomFile)) {
            pomDom = Xpp3DomBuilder.build(pomReader);
            configuration = this.extractPluginConfiguration("jsonschema-maven-plugin", pomDom);
        }
        MavenProject project = new MavenProject();
        // hack to get the plugin think that the classes in the testpackage are part of the project and get scanned
        project.getBuild().setOutputDirectory("target/test-classes");
        // Configure the Mojo
        SchemaGeneratorMojo myMojo = (SchemaGeneratorMojo) this.lookupConfiguredMojo(project, "generate");
        myMojo = (SchemaGeneratorMojo) this.configureMojo(myMojo, configuration);

        // And execute
        myMojo.execute();
    }
Execute the schema-generator plugin as define the the given pom file

@param pomFile The pom file
@throws Exception In case of problems
jsonschema-maven-plugin/src/test/java/com/github/victools/jsonschema/plugin/maven/SchemaGeneratorMojoTest.java