메이븐 dependency pom.xml에 추가

<dependency>
    <groupId>commons-cli</groupId>
    <artifactId>commons-cli</artifactId>
    <version>1.4</version>
</dependency>
import org.apache.commons.cli.*;
Options options = new Options();
Option input = new Option("t", "type", true, "running type");
input.setRequired(true);
options.addOption(input);

CommandLineParser parser = new DefaultParser();
HelpFormatter formatter = new HelpFormatter();
CommandLine cmd = null;

try {
    cmd = parser.parse(options, args);
} catch (ParseException e) {
    System.out.println(e.getMessage());
    formatter.printHelp("utility-name", options);

    System.exit(1);
}

String runtype = cmd.getOptionValue("type");

if (runtype.equals("1")) {

java 실행클래스 -t 1

 

https://link.coupang.com/a/NeVv5

 

웰라쥬 리얼 골드 콜라겐 원데이키트 10회분+2회분

COUPANG

www.coupang.com

이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다

AND