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

gu.sql2java.generator.plugin.HelpMojo Maven / Gradle / Ivy

There is a newer version: 5.3.2
Show newest version
package gu.sql2java.generator.plugin;

import java.io.File;
import java.net.URL;
import org.apache.maven.plugin.AbstractMojo;

import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;

import com.gitee.l0km.com4j.base.BinaryUtils;

import gu.sql2java.generator.Generator;

/**
 * maven 插件
* 输出的默认配置文件 * * @author guyadong * */ @Mojo(name = "help", requiresProject = false) public class HelpMojo extends AbstractMojo { /** * properties file output path
* output to "standard" output stream if absent */ @Parameter(property = "sql2java.output") private File outputFile; public HelpMojo() { } @Override public void execute() throws MojoExecutionException, MojoFailureException { try { URL url = HelpMojo.class.getResource("/sql2java.properties"); byte[] content = BinaryUtils.getBytes(url); if(outputFile != null){ getLog().info("OUTPUT PROPRETIES TO " + outputFile); BinaryUtils.saveBytes(content, outputFile, true); }else{ getLog().info("=========SQL2JAVA PROPERTIES============"); System.out.println(new String(content,"UTF-8")); getLog().info("========COMMAND LINE OPTIONS============="); Generator.main("--help"); } } catch (Exception e) { throw new MojoExecutionException(e.getMessage(),e); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy