阿里云服务器SpringBoot2.x生产环境部署

1、去除相关生产环境没用的jar
        比如热部署dev-tool

    2、本地maven打包成jar包 
        mvn clean package  -Dmaven.test.skip=true          跳过测试

       阿里云服务器SpringBoot2.x生产环境部署

 

      阿里云服务器SpringBoot2.x生产环境部署

        或者在ide里面右键项目run as----maven install

    3. 利用xftp或者远程连接工具 将jar包传到服务器上  java -jar xxxx.jar    守护进程启动服务

     阿里云服务器SpringBoot2.x生产环境部署

   4.       打包指定配置文件
            1、使用maven的profiles
            2、使用springboot的profile=active

        

    访问不了
        1、阿里云防火墙是否开启,可以选择关闭,关闭是不安全的,可以选择开放端口
        2、阿里云的安全访问组,开启对应的端口,如果应用是以80端口启动,则默认可以访问

  成熟的互联网公司应该有的架构
        本地提交生产代码->gitlab仓库->Jenkins自动化构建->运维或者开发人员发布