Springboot usage notes

Recently, the company is working on a micro-service project, and I am using it for the first time. In order to prevent forgetting in the future and be able to refer to it, I will close up my work experience and experience notes.
Do not float in appearance, just use.
1. Create mvn project
   Configure the dependencies required by the project (*start)
2. Compile:
     Select the project -- right click --> Run as --> Maven clean
3. Packaging:
       Select the project -- right click --> Run as --> Maven build (select the sixth one, if it has been configured, select the fifth one), as shown below:
     
A jar package will be generated in the target directory.
 Exception: a. If the jdk version error is reported, select the JRE tab in the figure above and configure the jdk version to solve the problem.
            b. Report that there is no independent main class exception, just delete the class with the main method in the system.
 Note: Enter the directory where the pom.xml file is located, and execute the command: mvn package can also be packaged (provided that the mvn environment variable must be configured)
 
4. Run:
      Select the project -- right click --> Run as --> Spring boot app, you can run it. Startup information will be output to the console.
      Exception: It is reported that Application.java cannot recognize the exception, and it can be solved by re-cleaning and packaging.
   Note: You can also use the following methods to run:
       
Running output:
6. Other instructions:
   If the local project maven is not up to date, select the project --> right click --> Maven --> Update Project to update the jar package.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326692457&siteId=291194637