idea-spring-boot打包jar/var_ide

下面的插件配置的里面需要加上具体的main类 

<groupId>org.springframework.boot</groupId>

            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <mainClass>com.quan.monitor.QuanApplication</mainClass>
            </configuration>

启动类当中继承build类:

idea-spring-boot打包jar/var_spring_02; "复制代码")

@SpringBootApplication public class QuanApplication extends SpringBootServletInitializer { public static void main(String[] args) {

    SpringApplication.run(QuanApplication.class, args);
}

@Override protected SpringApplicationBuilder configure(SpringApplicationBuilder builder){ return builder.sources(this.getClass());

}

}

idea-spring-boot打包jar/var_spring_02; "复制代码")

然后调用maven的生命周期就行:

idea-spring-boot打包jar/var_spring_04

结果:

idea-spring-boot打包jar/var_maven_05

其他步骤都差不多

第一步选择打包的方式,选为war

idea-spring-boot打包jar/var_ide_06

在进行install之前,先将下面的圈出来的文件都建立起来,web.xml不用写东西

idea-spring-boot打包jar/var_xml_07

 结果:

idea-spring-boot打包jar/var_生命周期_08