- Mastering Microservices with Java
- Sourabh Sharma
- 112字
- 2021-07-02 13:03:33
Maven build from the Command Prompt
Please make sure that Java and JAVA_HOME is set to Java 11 before executing the following commands.
Observe the following steps:
- To build the JAR file, perform the mvn clean package command from the Command Prompt from the parent project root directory (Chapter2). Here, clean and package are Maven goals:
mvn clean package
- This creates the JAR files in a respective target directory. We will now execute the JAR files generated in the Chapter2\rest\target directory. A JAR file can be executed using the following command:
java -jar rest\target\rest-1.0-SNAPSHOT-exec.jar
Please make sure you execute the JAR file having a postfix exec, as shown in the preceding command.