官术网_书友最值得收藏!

  • Spring 5.0 By Example
  • Claudio Eduardo de Oliveira
  • 183字
  • 2021-06-24 19:17:33

Command line via the JAR file

To run it through the Java file, we need to compile and package it, and then we can run the project with the Java command line. To compile and package it, we can use the pretty standard Maven command like this:

mvn clean install

After the project is compiled and packaged as a Fat-JAR, we can execute the JAR file, go to the target folder and check the files from this folder, probably the result will look like this:

We have two main files in our target folder, the cms-0.0.1-SNAPSHOT.jar and the cms-0.0.1-SNAPSHOT.jar.originalthe file with the .original extension is not executable. It is the original artifact resulting from the compilation, and the other is our executable file. It is what we are looking for, let's execute it, type the following command:

java -jar cms-0.0.1-SNAPSHOT.jar

The result should be as displayed. The application is up and running:

That is it for this part, in the next section, we will create the first REST (Representational State Transfer) resources and understand how the REST endpoints work.

主站蜘蛛池模板: 南昌县| 图片| 台山市| 白山市| 桐乡市| 城市| 崇阳县| 庐江县| 额敏县| 上思县| 金华市| 营口市| 吉木乃县| 耒阳市| 乌兰浩特市| 房产| 启东市| 临泽县| 乌拉特中旗| 南宁市| 寿阳县| 浦城县| 鹤山市| 石门县| 申扎县| 辽阳市| 手游| 扬中市| 垦利县| 黄梅县| 孝感市| 肥东县| 三明市| 南平市| 英山县| 诏安县| 礼泉县| 渝北区| 博兴县| 丰台区| 平舆县|