第一步:确定项目的打包形式是war 形式 war
第二步:在pom.xml中加入依赖 ,加入依赖的目的是派出内嵌的tomcat
org.springframework.boot spring-boot-starter-tomcat provided第三步:pom.xml中 加入maven编译插件
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<!-- since 2.0 -->
<version>3.7.0</version>
<configuration>
<!-- use the Java 8 language features -->
<source>1.8</source>
<!-- want the compiled classes to be compatible with JVM 1.8 -->
<target>1.8</target>
<!-- The -encoding argument for the Java compiler. -->
<encoding>UTF8</encoding>
</configuration>
</plugin>
第四步:修改启动类,继承SpringBootServletInitializer,并重写configure方法,重写之后项目右键RunAs–>Maven bulid…–>package 打包成功之后去自己项目的target路径下复制 打包成功的war包 ,粘贴到tomcat 服务器下的webapps下然后启动tomcat 就可以了,出现以下界面就表示手动部署成功,就可以同通过浏览器正常访问了
作者:fuyixin
来源:CSDN
版权声明:本文为博主原创文章,转载请附上博文链接!