<build> <plugins> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.2</version> <configuration> <uriEncoding>utf-8</uriEncoding> <path>/</path> <port>8080</port> </configuration> </plugin> </plugins> </build>
启动后控制台信息
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.example:springday13_ssm_crm >-------------------
[INFO] Building springday13_ssm_crm 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.2:run (default-cli) > process-classes @ springday13_ssm_crm >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ springday13_ssm_crm ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ springday13_ssm_crm ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.2:run (default-cli) < process-classes @ springday13_ssm_crm <<<
[INFO]
[INFO]
[INFO] --- tomcat7-maven-plugin:2.2:run (default-cli) @ springday13_ssm_crm ---
[INFO] Skipping non-war project
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.360 s
[INFO] Finished at: 2022-06-04T16:38:37+08:00
[INFO] ------------------------------------------------------------------------
Process finished with exit code 0
经过排查找到错误原因:
是没有设置其打成war包
<packaging>war</packaging>