// Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Database.java
// public interface Database {
// 
//     /**
//      * Find the loader that supports the source file and use it to load the data
//      * into or execute the script against the database.
//      *
//      * @param logger Used to report errors and raise exceptions.
//      * @param source The source file containing data or script.
//      */
//     void load(Logger logger, Source source);
// }
// 
// Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Source.java
// public interface Source {
// 
//     /**
//      * Get the source file that contains the DDL/DML script or DBUnit data set.
//      *
//      * @return The source file.
//      */
//     String getSourceFile();
// 
//     /**
//      * Determine if the table names in the source file are fully qualified.
//      *
//      * @return <ul>
//      *         <li>{@link Boolean#TRUE} if the table names are fully qualified.</li>
//      *         <li>{@link Boolean#FALSE} if the table names are not fully qualified.</li>
//      *         </ul>
//      */
//     Boolean getQualifiedTableNames();
// }


import com.btmatthews.maven.plugins.inmemdb.Database;
import com.btmatthews.maven.plugins.inmemdb.Source;
import com.btmatthews.utils.monitor.Logger;
import com.btmatthews.utils.monitor.Server;
import com.btmatthews.utils.monitor.mojo.AbstractRunMojo;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
        if (port != null) {
            config.put("port", port);
        }
        if (password == null) {
            config.put("password", "");
        } else {
            config.put("password", password);
        }

        if (attributes != null) {
            config.put("attributes", attributes);
        }

        return config;
    }

    /**
     * This callback is invoked after the server has started and is used load the scripts
     * and datasets that will initialise the database.
     *
     * @param server The database server.
     * @param logger Used to log information and error messages.
     */
    @Override
    public void started(final Server server, final Logger logger) {
        logger.logInfo("Server has been started");
        if (sources != null) {
            logger.logInfo("Executing initialization scripts and loading data sets");
            for (final Source source : sources) {
                logger.logInfo("Loading " + source.toString());
// Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Database.java
// public interface Database {
// 
//     /**
//      * Find the loader that supports the source file and use it to load the data
//      * into or execute the script against the database.
//      *
//      * @param logger Used to report errors and raise exceptions.
//      * @param source The source file containing data or script.
//      */
//     void load(Logger logger, Source source);
// }
// 
// Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/Source.java
// public interface Source {
// 
//     /**
//      * Get the source file that contains the DDL/DML script or DBUnit data set.
//      *
//      * @return The source file.
//      */
//     String getSourceFile();
// 
//     /**
//      * Determine if the table names in the source file are fully qualified.
//      *
//      * @return <ul>
//      *         <li>{@link Boolean#TRUE} if the table names are fully qualified.</li>
//      *         <li>{@link Boolean#FALSE} if the table names are not fully qualified.</li>
//      *         </ul>
//      */
//     Boolean getQualifiedTableNames();
// }


// Path: src/main/java/com/btmatthews/maven/plugins/inmemdb/mojo/RunMojo.java
import com.btmatthews.maven.plugins.inmemdb.Database;
import com.btmatthews.maven.plugins.inmemdb.Source;
import com.btmatthews.utils.monitor.Logger;
import com.btmatthews.utils.monitor.Server;
import com.btmatthews.utils.monitor.mojo.AbstractRunMojo;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

        if (port != null) {
            config.put("port", port);
        }
        if (password == null) {
            config.put("password", "");
        } else {
            config.put("password", password);
        }

        if (attributes != null) {
            config.put("attributes", attributes);
        }

        return config;
    }

    /**
     * This callback is invoked after the server has started and is used load the scripts
     * and datasets that will initialise the database.
     *
     * @param server The database server.
     * @param logger Used to log information and error messages.
     */
    @Override
    public void started(final Server server, final Logger logger) {
        logger.logInfo("Server has been started");
        if (sources != null) {
            logger.logInfo("Executing initialization scripts and loading data sets");
            for (final Source source : sources) {
                logger.logInfo("Loading " + source.toString());
                ((Database) server).load(this, source);