springspring-bootembedded-tomcat-7

How to create/find application jar to deploy your spring boot maven application using embedded tomcat?


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 ?


Solution

  • 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