All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hotrod.plugin.maven.ExportColumnsToXLSXMojo Maven / Gradle / Ivy

There is a newer version: 4.8.1
Show newest version
package org.hotrod.plugin.maven;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.hotrod.plugin.ExportColumnsToXLSXOperation;

@Mojo(name = "export-columns-xlsx", defaultPhase = LifecyclePhase.COMPILE)
public class ExportColumnsToXLSXMojo extends AbstractMojo {

  private static transient final Logger log = LogManager.getLogger(ExportColumnsToXLSXMojo.class);

  // Note: 1) Each property must be annotated by @Parameter. 2) The property
  // attribute -- if declared -- must be the exact same name as the Java member

  @Parameter(property = "configfile")
  private String configfile = null;

  @Parameter(property = "localproperties")
  private String localproperties = null;

  @Parameter(property = "jdbcdriverclass")
  private String jdbcdriverclass = null;

  // Loaded locally

  @Parameter(property = "jdbcurl")
  private String jdbcurl = null;

  @Parameter(property = "jdbcusername")
  private String jdbcusername = null;

  @Parameter(property = "jdbcpassword")
  private String jdbcpassword = null;

  @Parameter(property = "jdbccatalog")
  private String jdbccatalog = null;

  @Parameter(property = "jdbcschema")
  private String jdbcschema = null;

  @Parameter(property = "facets", defaultValue = "")
  private String facets = null;

  @Parameter(property = "display", defaultValue = "list")
  private String display = null;

  @Parameter(property = "xlsxexportfile")
  private String xlsxexportfile = null;

  // Project information

  @Parameter(defaultValue = "${project}", required = true, readonly = true)
  private MavenProject project;

  // Mojo logic

  public void execute() throws MojoExecutionException {
    log.debug("init");

    log.debug("this.localproperties=" + this.localproperties);

    ExportColumnsToXLSXOperation op = new ExportColumnsToXLSXOperation(this.project.getBasedir(), this.configfile,
        this.localproperties, this.jdbcdriverclass, this.jdbcurl, this.jdbcusername, this.jdbcpassword,
        this.jdbccatalog, this.jdbcschema, this.facets, this.display, this.xlsxexportfile);

    try {
      op.execute(new MojoFeedback(this));
    } catch (Exception e) {
      throw new MojoExecutionException(e.getMessage(), e.getCause());
    }
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy