Search code examples
spring-bootembedded-tomcat-8

eclipse shutdown button can not shutdown embedded tomcat used fo spring boot


I'm using embedded tomcat in my spring boot application. I tun application with goal below:

clean spring-boot:run

and it runs with no error. I use eclipse shutdown button to shut it down. second time i try to run it i get this :

Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project cpanel: Failed to clean project: Failed to delete XXXXXXXXX\target\classes\hibernate\security\user\User.hbm.xml -> [Help 1]

it sims tomcat can't delete target for next time. whats wrong with my tomcat? Am i doing some thing wrong?

My server configuration in application.yml:

server:
compression:
    enabled: true
port: 8080
servlet-path: /rest

and my tomcat dependency:

<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-jasper</artifactId>
    <scope>provided</scope>
</dependency>

Solution

  • To solve this problem, change tomcat maven plugin and add fork to false

       <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <fork>false</fork>
            </configuration>
      </plugin>