Run a Java Main Method in Maven (#9636)

This commit is contained in:
Mona Mohamadinia
2020-07-13 20:44:30 +04:30
committed by GitHub
parent db13e0ec44
commit fc6dc42152
4 changed files with 77 additions and 0 deletions
@@ -0,0 +1,18 @@
package com.baeldung.main;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Arrays;
public class Exec {
private static final Logger LOGGER = LoggerFactory.getLogger(Exec.class);
public static void main(String[] args) {
LOGGER.info("Running the main method");
if (args.length > 0) {
LOGGER.info("List of arguments: {}", Arrays.toString(args));
}
}
}