class AbstractGenerateMojo extends AbstractSpeedmentMojo {

    private static final Logger LOGGER = LoggerManager.getLogger(AbstractGenerateMojo.class);
    
    @Parameter(defaultValue = "${project}", required = true, readonly = true)
    private MavenProject mavenProject;
    
    private @Parameter(defaultValue = "${debug}") Boolean debug;
    private @Parameter(defaultValue = "${dbms.host}") String dbmsHost;
    private @Parameter(defaultValue = "${dbms.port}") int dbmsPort;
    private @Parameter(defaultValue = "${dbms.username}") String dbmsUsername;
    private @Parameter(defaultValue = "${dbms.password}") String dbmsPassword;
    private @Parameter(defaultValue = "${components}") String[] components;
    private @Parameter(defaultValue = "${typeMappers}") Mapping[] typeMappers;
    private @Parameter ConfigParam[] parameters;
    private @Parameter(defaultValue = "${configFile}") String configFile;

    protected AbstractGenerateMojo() {}
    
    protected AbstractGenerateMojo(Consumer<ApplicationBuilder<?, ?>> configurer) { super(configurer); }
    
    @Override
    public void execute(Speedment speedment) throws MojoExecutionException, MojoFailureException {<FILL_FUNCTION_BODY>}
    
    @Override
    protected MavenProject project() {
        return mavenProject;
    }

    @Override
    protected String[] components() {
        return components;
    }
    
    @Override
    protected Mapping[] typeMappers() {
        return typeMappers;
    }
    
    @Override
    protected ConfigParam[] parameters() {
        return parameters;
    }
    
    public String getConfigFile() {
        return configFile;
    }
    
    @Override
    protected boolean debug() {
        return (debug != null) && debug;
    }
    
    @Override
    protected String dbmsHost() {
        return dbmsHost;
    }

    @Override
    protected int dbmsPort() {
        return dbmsPort;
    }

    @Override
    protected String dbmsUsername() {
        return dbmsUsername;
    }

    @Override
    protected String dbmsPassword() {
        return dbmsPassword;
    }
    
    public void setTypeMappers(Mapping[] typeMappers) {
        this.typeMappers = typeMappers;
    }

}

        getLog().info("Generating code using JSON configuration file: '" + configLocation().toAbsolutePath() + "'.");
        
        if (hasConfigFile()) {
            try {
                final Project project = speedment.getOrThrow(ProjectComponent.class).getProject();
                speedment.getOrThrow(TranslatorManager.class).accept(project);

                // after generating the speedment code, the package location needs to be added as a source folder
                if (!mavenProject.getCompileSourceRoots().contains(mavenProject.getBasedir().getAbsolutePath() + "/" + project.getPackageLocation())) {
                    getLog().info("Adding new source location");
                    mavenProject.addCompileSourceRoot(mavenProject.getBasedir().getAbsolutePath() + "/" + project.getPackageLocation());
                }
            } catch (final Exception ex) {
                final String err = "Error parsing configFile file.";
                LOGGER.error(ex, err);
                getLog().error(err);
                throw new MojoExecutionException(err, ex);
            }
        } else {
            final String err = "To run speedment:generate a valid configFile needs to be specified.";
            getLog().error(err);
            throw new MojoExecutionException(err);
        }
    
<methods>public final void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException<variables>private static final java.nio.file.Path DEFAULT_CONFIG,private static final Consumer<ApplicationBuilder<?,?>> NOTHING,static final java.lang.String SPECIFIED_CLASS,private final non-sealed Consumer<ApplicationBuilder<?,?>> configurer,public java.lang.String dbmsConnectionUrl