若依前后端分类项目宝塔部署

1.打包ruoyi-admin

mvn clean package -DskipTests

注意事项:
如果若依项目中模块中引入了本地jar包,需要修改ruoyi-admin下的pom.xml文件
假如:ruoyi-fish模块需要引入本地jar包
在这里插入图片描述

<dependency>
    <groupId>org.tron.trident</groupId>
    <artifactId>abi</artifactId>
    <version>0.7.0</version>
    <scope>system</scope>
    <systemPath>${project.basedir}/lib/abi-0.7.0.jar</systemPath>
</dependency>

修改ruoyi-admin下的pom.xml文件
在这里插入图片描述

 <!-- 如果没有该配置,ruoyi-fish中lib中的jar包不会被打包进去 -->
<includeSystemScope>true</includeSystemScope>
   <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.5.15</version>
                <configuration>
                    <fork>true</fork> <!-- 如果没有该配置,devtools不会生效 -->
                    <includeSystemScope>true</includeSystemScope> <!-- 如果没有该配置,ruoyi-fish中lib中的jar包不会被打包进去 -->
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <warName>${project.artifactId}</warName>
                </configuration>
            </plugin>
        </plugins>
        <finalName>${project.artifactId}</finalName>
    </build>

2. 打包打包前端vue

yarn build:prod

3. 宝塔新建纯静态站点

  1. 上传前端代码
  2. 修改前端nginx配置
  	location / {
  		# 换成自己的前端地址
  		root   /home/ruoyi/projects/ruoyi-h5;
  		try_files $uri $uri/ /index.html;
          index  index.html index.htm;
      }
  	
  	# 默认所有路径
      location /prod-api/ {
          proxy_set_header Host $http_host;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header REMOTE_HOST $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  		proxy_set_header X-Forwarded-Proto $scheme;
  		proxy_set_header X-NginX-Proxy true;
  		
          # 反向代理配置
          proxy_pass http://localhost:8080/;
      }
  	
      error_page   500 502 503 504  /50x.html;
      location = /50x.html {
          root   html;
      }
  1. 新建java项目站点

在这里插入图片描述
需要在ruoyi-admin.jar目录新增两个文件夹logs和uploadPath
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值