zoukankan      html  css  js  c++  java
  • 12.19手动 项目部署

    部署两种方式

    tomcat

    不好设置多个环境,多个程序不同端口需要设置

    java -jar框架命令启动,可以指定参数

    命令进入项目目录 sell git:(develop)

    项目打包,并跳过单元测试: mvn clean package -Dmaven.test.skip=true

    如果不想要版本号,直接在项目pom.xml里面配置

    <finalName>sell</finalName>

    连接虚拟机 ssh root@192.168.1.1

    进入放文件的文件夹 cd /目录

    启动jar包 java -jarsell.jar

    修改端口: java -jar -Dserver.port=8090 sell.jar

    服务器端不需要sql打印,

    将项目配置文件复制一份

    jpa:
        show-sql: true
    

     将有sql输出的取名 applicatio0n-dev.yml

    没sql输出的取名 application-prod.yml,同时创建新的application.yml项目配置文件,并配置

    spring:
        profiles:
            active:dev
    

     ,本地启动项目默认启动有sql输出的文件,

    在服务器里运行没有sql输出的文件: java -jar -Dserver.port=8090  -Dspring.profiles.active=prod sell.jar sell.jar

    让项目后台运行 nohup java -jar sell.jar > /dev/null 2>&1 $

    运行后会有相应的进程号,可以命令查询项目是否运行: ps -ef |grep sell.jar

     

  • 相关阅读:
    Leetcode 290 Word Pattern
    Leetcode 205 Isomorphic Strings
    Leetcode 345 Reverse Vowels in a String
    Leetcode 151 Reverse Words in a String
    Leetcode 344 Reverse String
    Leetcode 383 Ransom Note
    leetcode 387 First Unique Character in a String
    反码补码和位运算
    SpringBoot进阶
    布隆过滤器
  • 原文地址:https://www.cnblogs.com/tanghao666/p/8066617.html
Copyright © 2011-2022 走看看