org.yes.tools.build.bo.DeployBo Maven / Gradle / Ivy
package org.yes.tools.build.bo;
import lombok.Data;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Parameter;
import java.util.List;
/**
* @author Co.
* @name DeployMojo
* @date 2023/9/14 10:55
*/
public class DeployBo extends AbstractMojo {
@Parameter(property = "deploy")
public Deploy deploy = new Deploy();
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
}
public static class Deploy {
/**
* 模式:cloudImage--云镜像部署 localImage--本地镜像 jar--jar包部署
*/
@Parameter(property = "mode", required = true)
public String mode;
/**
* 远程主机
*/
@Parameter(property = "remote")
public Remote remote = new Remote();
/**
* 云镜像
*/
@Parameter
public CloudImage cloudImage = new CloudImage();
/**
* 项目
*/
@Parameter
public Project project = new Project();
}
@Data
public static class CloudImage {
/**
* 仓库地址
*/
@Parameter(required = true)
private String registry;
/**
* 命名空间
*/
@Parameter(required = true)
private String namespace;
/**
* 账号
*/
@Parameter(required = true)
private String username;
/**
* 密码
*/
@Parameter(required = true)
private String password;
}
@Data
public static class Remote {
/**
* 远程主机的IP
*/
@Parameter(required = true)
private String remoteHost;
/**
* 远程主机的账号
*/
@Parameter(required = true)
private String username;
/**
* 远程主机的密码
*/
@Parameter(required = true)
private String password;
/**
* 远程主机的端口
*/
@Parameter(required = true)
private int remotePort;
}
@Data
public static class Project {
/**
* 工作id
*/
@Parameter(required = true)
private String artifactId;
/**
* 版本
*/
@Parameter(required = true)
private String version;
/**
* 环境
*/
@Parameter(required = true)
private String active;
/**
* 端口
*/
@Parameter(required = true)
private List port;
/**
* docker参数
*/
@Parameter(defaultValue = "")
private String dockerParameter;
/**
* jar参数
*/
@Parameter(defaultValue = "")
private String jarParameter;
/**
* jvm参数
*/
@Parameter(defaultValue = "-server -Xms512m -Xmx1g -Duser.timezone=Asia/Shanghai")
private String jvmParameter;
}
}