au.net.causal.maven.plugins.boxdb.db.BaseMySqlFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of boxdb-maven-plugin Show documentation
Show all versions of boxdb-maven-plugin Show documentation
Maven plugin to start databases using Docker and VMs
package au.net.causal.maven.plugins.boxdb.db;
/**
* Base factory for MySQL and MariaDB databases, since they have many things in common.
*/
public abstract class BaseMySqlFactory extends DockerDatabaseFactory
{
protected BaseMySqlFactory(String name)
{
super(name);
}
@Override
protected void initializeDefaults(BoxConfiguration boxConfiguration)
{
if (boxConfiguration.getDatabaseUser() == null)
boxConfiguration.setDatabaseUser("app");
if (boxConfiguration.getDatabasePassword() == null)
boxConfiguration.setDatabasePassword(boxConfiguration.getDatabaseUser());
if (boxConfiguration.getAdminUser() == null)
boxConfiguration.setAdminUser("root");
if (boxConfiguration.getAdminPassword() == null)
boxConfiguration.setAdminPassword("mysqlbox");
if (boxConfiguration.getDatabaseName() == null)
boxConfiguration.setDatabaseName("app");
if (boxConfiguration.getDatabasePort() <= 0)
boxConfiguration.setDatabasePort(3307);
super.initializeDefaults(boxConfiguration);
}
}