Springboot Creating an executable jar

Source: Internet
Author: User

Creating an executable jar

We can also create an executable jar file that runs in a production environment through a plugin to complete our example.

First, the dependency is introduced:

<build>    <plugins>      <plugin>        <groupid>org.springframework.boot</groupid >        <artifactId>spring-boot-maven-plugin</artifactId>        <executions>          < execution>            <goals>              <goal>repackage</goal>            </goals>          </execution >        </executions>      </plugin>    </plugins></build>

Open the cmd command in the project directory and use the MVN Package command as follows:

  

If you want to view the packaged jar file internal directory, you can use the command jar TVF Target/myproject-0.0.1-snapshot.jar to view the directory structure;

Use Java-jar Target\spring-boot-hello-1.0-snapshot.jar to launch the application as follows:

  

Test results as shown in 3.4;

If you encounter an error that does not have a master inventory directory at startup, see: http://www.cnblogs.com/lfalex0831/p/8967428.html

Copyright NOTICE: This article for Bo Master original article, reproduced please indicate the source, thank you!

Springboot Creating an executable jar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.