private Log logger;
public void execute() throws MojoExecutionException, MojoFailureException {
Injector injector = DIBootstrap.createInjector(new ToolModule());
AdhocObjectFactory objectFactory = injector
.getInstance(AdhocObjectFactory.class);
logger = new MavenLogger(this);
logger.debug(String
.format("connection settings - [driver: %s, url: %s, username: %s, password: %s]",
driver, url, username, password));
logger.info(String
.format("importer options - [map: %s, overwriteExisting: %s, schemaName: %s, tablePattern: %s, importProcedures: %s, procedurePattern: %s, meaningfulPk: %s, namingStrategy: %s]",
map, overwriteExisting, schemaName, tablePattern,
importProcedures, procedurePattern, meaningfulPk,
namingStrategy));
try {
final DbAdapter adapterInst = (adapter == null) ? (DbAdapter) objectFactory
.newInstance(DbAdapter.class, JdbcAdapter.class.getName())
: (DbAdapter) objectFactory.newInstance(DbAdapter.class,
adapter);
// load driver taking custom CLASSPATH into account...
DriverDataSource dataSource = new DriverDataSource((Driver) Class
.forName(driver).newInstance(), url, username, password);