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

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.

主站蜘蛛池模板: 梓潼县| 荃湾区| 乌拉特前旗| 江阴市| 隆回县| 麟游县| 马边| 东乌| 宣汉县| 鹤壁市| 平谷区| 昌江| 邯郸市| 工布江达县| 哈密市| 尼勒克县| 临沭县| 上思县| 玉龙| 永顺县| 建瓯市| 柏乡县| 旺苍县| 杭锦后旗| 什邡市| 小金县| 长宁区| 昭通市| 汾西县| 永川市| 昌平区| 海宁市| 天峻县| 义马市| 固原市| 鄂托克旗| 淮北市| 怀化市| 梁河县| 响水县| 木兰县|