1

I want to deploy my application using the embedded tomcat in spring -boot. I figured that I have to run the java -jar spring-boot-app.jar command, but I cannot find the jar file for the application anywhere.

On running mvn clean package I am able to generate a war file to deploy externally, how can I do the same with embedded tomcat ?

Denise
  • 898
  • 1
  • 16
  • 30

2 Answers2

0

You need to remove following line from pom.xml

<packaging>war</packaging>

or replace war packaging with jar. Make sure you have spring-boot-maven-plugin in maven build plugins

The jar should then be available in target folder

sidgate
  • 14,650
  • 11
  • 68
  • 119
0

To create an executable jar, we need to add the spring-boot-maven-plugin to our pom.xml. To do so, insert the following lines just below the dependencies section:

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

For more information,refer this : https://docs.spring.io/spring-boot/docs/current/reference/html/getting-started.html

javaguy
  • 927
  • 2
  • 16
  • 37