打包发布到Tomcat】的更多相关文章

近段时间 做了一些前后端的开发 需要在Tomcat里进行发布    把自己整理的分享出来 后端打包 pom.xml 文件 <packaging>war</packaging> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>pro…
File-> Project Structure... 点击Artifacts->+号 点击Web Application:Archive->选择与你的项目对应的那一项Artifacts 选中刚新增的war->勾选 Include in project build->ok Build->Build Artifacts... 点击对应的Artifact 建立成功后可以在项目out目录中看到这个war包 将包拷贝到tomcat的webapps目录中(服务运行后会自动解压,注…
idea:      file-->project structure -->  Artifacts --> 点+号 web application exploded  from modules --> 添加当前项目的exploded -->  继续+号添加web application archive  for exploded --> 有跳出东西选默认  点击工具栏的“”build” --> build artifacts --> all artifac…
先吐槽一下,花了我3个小时,心累 本地运行正常,发布时maven插件里要加utf-8编码 https://blog.csdn.net/testcs_dn/article/details/45583791 <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <ver…
在应用下面加 WEB-INF 建 web.xml 内容如下 <?xml version="1.0" encoding="ISO-8859-1"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="ht…
Liunx服务器上打包发布web工程(开发工具Idea) 1.首先使用Idea自带的打包功能(点击package打包) 2.然后链接到服务器(我这里用的是Xshell链接工具) 3.将打好的war包传送到服务器端 (进入tomcat所在目录的命令,例如: cd user/tomcat/apacher-tomcat-7.0.54/bin) 4.在服务器上解压war包(进入war所在目录),输入jar -xvf itm-dashboard.war(自己的war包名) 5.停掉tomcat服务器,然后…
概述 上篇记录了IDEA上创建Maven SpringBoot+mybatisplus+thymeleaf 项目,但是如何将SpringBoot发布到Tomcat,直接采用Maven 命令Clear-Package指令之后,生成的War并不能访问,任然显示404错误.所以这个时候,需要修改代码内容部分: 代码调整项 1.修改pom.xml文件: (1).finalName要和Application.properties中的server.context-path值保持一致: <build> &l…
一.单元测试 生成的demo里面包含spring-boot-starter-test :测试模块,包括JUnit.Hamcrest.Mockito,没有的手动加上. <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> </dependency> 添加测试类: @RunWith…
部署到tomcat的方法 注意:在eclipse 或 idea 上需要引入外部tomcat 1.将程序打成war包启动tomcat 2.将target 文件下内容压缩城zip,发布到tomcat ROOT下.重启tomcat 我们主要用第二种方式,简单快速 修改html,js,css不用重新发版,直接在服务器上替换相应的文件.但是要清空浏览器缓存才能看到效果.或者在js,css路径后加一个版本号,该版本号在应用重启时生成,这样相当于清理了客户端js ,css 缓存. 修改java文件,又不想重新…
昨天看了一篇tomcat设置的文章,说要把第一个勾上,这样不需要更新到tomcat.  一启动tomcat就发现丢包.后来在网上看了许多文章,说要update maeven项目,然后你就会发现启动过程报如下错误: Java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener, 这时候请参考此文.http://www.cnblogs.com/zjrodger/p/5439637.htm…