Home  >  Article  >  Java  >  How to import the springboot project into a jar package and run it

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

WBOY
WBOYforward
2023-05-14 13:10:062648browse

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>

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!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete