使⽤idea打包springcloud项⽬并部署到tomcat下
说明:有三个项⽬,
⼀个提供 eureka 服务——ehl-eureka-server1,
⼀个数据接⼝服务——apps-is,
⼀个web服务-appsweb
使⽤ idea 打成 war 包:
build->build artifacts-->选择 all 或者选择单个
16个基本导数公式都是什么在⼯作空间下到 war 包,⽐如:
E:\workspace-mars\mps\mps-apps-is\target
部署到 tomcat
前置⼯作
准备 3 个 tomcat
备注:也可以部署在同⼀个 tomcat 下,但是如果有问题不好排查
分别部署 ehl-eureka-server1,apps-is,appsweb
1、修改 war 包名为 l ⽂件中 t-path 的名字
2、分别修改 tomcat 端⼝为 server.port 的端⼝为
ehl-eureka-server1apps-is appsweb
876187628765
800980108011
800580068007启动 tomcat
按照顺序:先 eureka,后 appis,最后 appsweb,启动 tomcat。
双击 startup.bat 启动,如果出现闪退,可能是环境有问题,在 startup.bat 最后添加 pause 查看
如果是环境的问题,则可以在⽂件最前⾯加上下⾯的代码(修改为⾃⼰的 java 地址和 tomcat 地址)set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131
createrepo 命令详解set TOMCAT_HOME=D:\soft\apache-tomcat-8.5.34-windows-x64\apache-tomcat-8.5.34-01
set CATALINA_HOME=D:\soft\apache-tomcat-8.5.34-windows-x64\apache-tomcat-8.5.34-01
缺什么加什么即可。
@echo off
rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements.  See the NOTICE file distributed with
rem this work for additional information regarding copyright ownership.
rem The ASF licenses this file to You under the Apache License, Version 2.0
rem (the "License"); you may not use this file except in compliance with
rem the License.  You may obtain a copy of the License at
rem
rem    /licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. rem See the License for the specific language governing permissions and
rem limitations under the License.
rem ---------------------------------------------------------------------------
rem Start script for the CATALINA Server
rem ---------------------------------------------------------------------------
setlocal
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131
jhtml是什么意思set TOMCAT_HOME=D:\soft\apache-tomcat-8.5.34-windows-x64\apache-tomcat-8.5.34-01 set CATALINA_HOME=D:\soft\apache-tomcat-8.5.34-windows-x64\apache-tomcat-8.5.34-01
rem Guess CATALINA_HOME if not defined
自学网官方app下载
set "CURRENT_DIR=%cd%"
if not "%CATALINA_HOME%" == "" goto gotHome
set "CATALINA_HOME=%CURRENT_DIR%"
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
idea配置artifactscd ..
set "CATALINA_HOME=%cd%"
cd "%CURRENT_DIR%"
:gotHome
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
echo The CATALINA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome
set "EXECUTABLE=%CATALINA_HOME%\bin\catalina.bat"
rem Check that target executable exists
if exist "%EXECUTABLE%" goto okExec
echo Cannot find "%EXECUTABLE%"
echo This file is needed to run this program
goto end
:okExec
rem Get remaining unshifted command line arguments and save them in the
set CMD_LINE_ARGS=
:setArgs
if ""%1""=="""" goto doneSetArgs
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto setArgs
:doneSetArgs
call "%EXECUTABLE%" start %CMD_LINE_ARGS%
:end中国慕课网app
最后如果出现 eureka 和 appis 都没有问题,webs ⽹站有问题的话,如果部署的服务器是 windows 系统,则可以单独使⽤ idea 启动webs,这样⽅便检查错误以及修改代码改正错误。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。