Home > Java > javaTutorial > body text

How to import the springboot project into a jar package and run it

WBOY
Release: 2023-05-14 13:10:06
forward
2689 people have browsed it

1. The jar package of springboot is embedded with tomcat, so you only need to export it and run it directly.

2. Then go to IDEA's pom.xml folder and add a packaging tag

<version>0.0.1-SNAPSHOT</version>
    <!--打包成jar-->
<packaging>jar</packaging>
Copy after login

3. Select Maven Projects in the lower left corner of IDEA, clean it first, and then double-click the package to start packaging.

4. After running, you will find that there is an additional target folder in the project, which contains the generated jar package.

5. Window R brings up the running window, then cmd, enter the location of the jar package, then java -jar plus the name of the jar package, the jar package successfully runs in the background! !

6. If it runs successfully, the jar package is completed! You can happily enter http://localhost:8080/*** in the browser.

7. To stop the running of the jar package, find java.exe in the task manager and then pause the task.

The above is the detailed content of How to import the springboot project into a jar package and run it. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template