Deploying aggregated Maven project with Tomcat

Time:2021-2-22

Recently, when I was working on SSM project (enterprise rights management system) and using Tomcat to deploy Maven’s collection project, I encountered some problems.
Deploying aggregated Maven project with Tomcat
Deploying aggregated Maven project with Tomcat

The reason is that the service class cannot be found and cannot be created. As a result, the service attribute cannot be injected into the controller and the initialization of the controller fails.
Before I did Maven aggregation project, I used Maven plug-in to deploy, and deployed directly using Tomcat.
Deploying aggregated Maven project with Tomcat
Deploying aggregated Maven project with Tomcat

Let’s first analyze Maven’s polymerization engineering.
The detailed Maven aggregation project is created and deployed:https://www.cnblogs.com/limn/…
Maven polymerization Engineering:
1. The packaging method of the parent project must be POM
Deploying aggregated Maven project with Tomcat
2. Inheritance
The dependency introduced in the parent project POM can be used in the child project.
3. The relationship between aggregation and inheritance in Maven
Deploying aggregated Maven project with Tomcat

Analysis of the construction of web applications
1. The packaging method of parent project is POM
2. The packaging method of Web project is war
3. The packaging method of other projects is jar
Deploying aggregated Maven project with Tomcat

Recommended Today

MySQL partition

MySQL partition Advantages of partitioning Store more data To optimize the query, only scan one or more necessary partitions. For count () and sum (), only summarize the partition statistics For data that is out of date or does not need to be saved, partitioning is faster Data queries are distributed across multiple disks to […]