Check out example codes for "run java program maven". It will help you in understanding the concepts better.

Code Example 1

mvn exec:java -Dexec.mainClass="com.vineetmanohar.module.Main" -Dexec.args="arg0 arg1 arg2"

Learn ReactJs, React Native from akashmittal.com