Commit 49994936 authored by YuCheng Hu's avatar YuCheng Hu

Spring boot command project

parent c567e7c6
Pipeline #47 failed with stages
package us.cwiki.spring.boot.command;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import java.util.Arrays;
public class Application implements ApplicationRunner {
private static final Logger logger = LoggerFactory.getLogger(Application.class);
public static void main(String[] args) throws Exception {, args);
public void run(ApplicationArguments args) throws Exception {"Application started with command-line arguments: {}", Arrays.toString(args.getSourceArgs()));"NonOptionArgs: {}", args.getNonOptionArgs());"OptionNames: {}", args.getOptionNames());
for (String name : args.getOptionNames()) {"arg-" + name + "=" + args.getOptionValues(name));
boolean containsOption = args.containsOption("");"Contains " + containsOption);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment