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

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.

主站蜘蛛池模板: 沙田区| 微山县| 长海县| 马龙县| 乐亭县| 改则县| 信宜市| 金华市| 阿拉尔市| 乡城县| 洞口县| 宁明县| 芦溪县| 巴林左旗| 曲阳县| 贵州省| 肇东市| 平遥县| 福贡县| 禹州市| 徐汇区| 若羌县| 松滋市| 石台县| 乐陵市| 德钦县| 庆阳市| 张家口市| 章丘市| 武穴市| 临高县| 噶尔县| 剑河县| 江北区| 南华县| 泾川县| 元阳县| 桑日县| 哈密市| 桂平市| 琼结县|