简体   繁体   中英

How to run Spring project on my local machine without Tomcat server by adding Spring Boot dependencies

I am working on a Spring project with many different folder structures inside it. I want to run one of the Spring module folder (project) on my local machine (want to create a local web container through Spring Boot dependency) without tomcat server.

I don't have Tomcat installed in my VMWare. So I have to add Spring Boot dependencies in pom.xml file. What should I do? Which dependencies should I add to run my project in local server?

No need of separate Tomcat installation. Spring Boot comes with embedded Tomcat. You can have parent and web dependency in your pom.xml :

<parent>        

     <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.7.2</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<dependencies>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
</dependencies>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM