Spring-boot is becoming a passionate framework for Java developers because of its high integration of jar packages and the benefits of simplified service provisioning, rapid deployment, and more. Here's how to create a new Spring-boot project and package your deployment in Eclipse.
There are two ways of creating spring-boot in Eclipse
Way One
Go to Spring-boot's online configuration website http://start.spring.io/; Customize your own project service components, download to local and import projects using eclipse
Service components:
Web:web project components, including jars such as spring mvc,tomcat,logback
JPA:JDBC request component, including ORM jar such as Hibernate,jboss
Devtools: Hot deploy component, can refresh service without restarting service
Right-Select the Import-maven-import Existing maven Projects in Eclipse, import the dowload maven package (if the imported project is not recognized, right-click Maven Update)
Way Two
Whether it's the None (neon) version of 16 or the latest oxygen (oxygen) version of Eclipse, the default plug-in is non-spring-boot and needs to be installed on its own.
plug-in installation :
Top navigation bar help-eclipse Marketplace, search Spring Tools or go to popular page, install plugins
After the plugin is installed, the Eclipse shortcut key "Ctrl+shift+o" may become invalid, Workaround: Toolbar-window-preferences-general-keys Search "organize Imports"
When the configuration value is modified , the shortcut key is re-effective
Create a project
New Project column supports Spring-boot project creation
Select service components based on project requirements
Enter the Springbootdemoapplication startup class and run the main method to start the service
Console display Tomcat8080 service started successfully
In the browser input http://localhost:8080/ access the project (spring-boot default project without project name access, you can add the application.properties configuration file Server.context-path to set)
Packaged
In the project local folder, press and hold crtl+shift+ right-click to open the Command window and execute the MVN clean package (to configure the MAVEN environment variable)
After the package is successful, a project jar package will be available under the project target directory
Jar Deployment
In the target directory crtl+shift+ right-click to open the Command window and execute the java-jar Project Jar command to start the service
War deployment
To change the Pom file packaging configuration to war, press and hold crtl+shift+ right-click in the Project Local folder to open the Command window and execute the MVN clean package
Put the packaged war into Tomcat's WebApps directory and launch Tomcat to access
Create a new Springboot project in Eclipse (packaged and deployed to Tomcat)