美文网首页
springboot打包 jar war

springboot打包 jar war

作者: 火山脚下 | 来源:发表于2020-03-22 10:03 被阅读0次
    //打jar包,还需要修改pom.xml文件的<packaging>jar</packaging>
    //@SpringBootApplication
    //public class Demo2Application{
    //  public static void main(String[] args) {
    //      SpringApplication.run(Demo2Application.class, args);
    //  }
    //}
    
    //打war包,还需要修改pom.xml文件的<packaging>war</packaging>
    @SpringBootApplication
    public class Demo2Application extends SpringBootServletInitializer {
    
        public static void main(String[] args) {
            SpringApplication.run(Demo2Application.class, args);
        }
    
        @Override
        protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
            return builder.sources(Demo2Application.class);
        }
    }
    
    image.png

    相关文章

      网友评论

          本文标题:springboot打包 jar war

          本文链接:https://www.haomeiwen.com/subject/cjjmyhtx.html