I. Creating a project and introducing dependencies
@
-
I. Creating a project and introducing dependencies
- Create Project
- Establishment of inter-engineering relationships
-
Configure pow configuration information in each project and related dependencies.
- pow configuration for the parent project (a.k.a. the master project project)
- pow configuration in demo-module06-generate module: Mybatis reverse engineering pow configuration
- pow configuration in demo-module05-environment module: environment depends on the pow configuration of the project
- demo-module04-util module pow configuration: tools project
- demo-module03-entity module pow configuration: entity class project
- demo-module02-component module pow configuration: component project pow configuration
- demo-module01-web module pow configuration: web project pow configuration
Create Project
Total Catalog Works:
Module Description:
project name | status | clarification |
---|---|---|
pro06-demo-ssm | parent project | Overall management of sub-projects |
demo-module01-web | sub-project | The only war package project |
demo-module02-component | sub-project | Managing the various components in a project |
demo-module03-entity | sub-project | Managing entity classes in a project |
demo-module04-util | sub-project | Managing tool classes in a project |
demo-module05-environment | sub-project | Framework environment dependencies |
demo-module06-generate | sub-project | Mybatis Reverse Engineering |
Note: Only one of them, demo-module01-web, should be packaged as
war
and at the same time set thewebapp
. The other modules arejar
The default packaging method for maven is jar, so you don't need to set it up.
The rest of the modules that follow are created in this way, so I won't explain more.
Establishment of inter-engineering relationships
Operation:
Configure pow configuration information in each project and related dependencies.
pow configuration for the parent project (a.k.a. the master project project)
The POM position is as follows: it is the total project works of the placement
The following configuration will be available once each sub-project has been created and does not need to be edited manually:
<groupId></groupId>
<artifactId>pro06-demo-ssm</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<modules>
<module>demo-module01-web</module>
<module>demo-module02-component</module>
<module>demo-module03-entity</module>
<module>demo-module04-util</module>
<module>demo-module05-environment</module>
<module>demo-module06-generate</module>
</modules>
pow configuration in demo-module06-generate module: Mybatis reverse engineering pow configuration
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="/POM/4.0.0"
xmlns:xsi="http:///2001/XMLSchema-instance"
xsi:schemaLocation="/POM/4.0.0 /xsd/maven-4.0.">
<parent>
<artifactId>pro06-demo-ssm</artifactId>
<groupId></groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>demo-module06-generate</artifactId>
<properties>
<>8</>
<>8</>
</properties>
<!-- dependenciesMyBatiscore package -->
<dependencies>
<dependency>
<groupId></groupId>
<artifactId>mybatis</artifactId>
<version>3.5.7</version>
</dependency>
</dependencies>
<!-- containmentMavenConfiguration during the build process -->
<build>
<!-- Plugins used in the build process -->
<plugins>
<!-- Specific plug-ins,Reverse engineering operations come in the form of plug-ins for the build process -->
<plugin>
<groupId></groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.0</version>
<!-- 插件的dependencies -->
<dependencies>
<!-- 逆向工程的核心dependencies -->
<dependency>
<groupId></groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.2</version>
</dependency>
<!-- database connection pool -->
<dependency>
<groupId></groupId>
<artifactId>c3p0</artifactId>
<version>0.9.2</version>
</dependency>
<!-- MySQLdrive (vehicle wheel) -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.30</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
pow configuration in demo-module05-environment module: environment depends on the pow configuration of the project
POM locations are listed below:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="/POM/4.0.0"
xmlns:xsi="http:///2001/XMLSchema-instance"
xsi:schemaLocation="/POM/4.0.0 /xsd/maven-4.0.">
<parent>
<artifactId>pro06-demo-ssm</artifactId>
<groupId></groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>demo-module05-environment</artifactId>
<properties>
<>8</>
<>8</>
</properties>
<dependencies>
<!-- SpringMVC -->
<dependency>
<groupId></groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.3.1</version>
</dependency>
<!-- Spring Required dependencies for the persistence layer -->
<dependency>
<groupId></groupId>
<artifactId>spring-orm</artifactId>
<version>5.3.1</version>
</dependency>
<!-- log (computing) -->
<dependency>
<groupId></groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
</dependency>
<!-- Spring5respond in singingThymeleafintegration pack -->
<dependency>
<groupId></groupId>
<artifactId>thymeleaf-spring5</artifactId>
<version>3.0.</version>
</dependency>
<!-- Mybatis respond in singing Spring 的integration pack -->
<dependency>
<groupId></groupId>
<artifactId>mybatis-spring</artifactId>
<version>2.0.6</version>
</dependency>
<!-- Mybatiscrux -->
<dependency>
<groupId></groupId>
<artifactId>mybatis</artifactId>
<version>3.5.7</version>
</dependency>
<!-- MySQLdrive (vehicle wheel) -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.3</version>
</dependency>
<!-- data sources -->
<dependency>
<groupId></groupId>
<artifactId>druid</artifactId>
<version>1.0.31</version>
</dependency>
</dependencies>
</project>
demo-module04-util module pow configuration: tools project
No configuration is required for this project
demo-module03-entity module pow configuration: entity class project
No configuration is required for this project
demo-module02-component module pow configuration: component project pow configuration
POM locations are listed below:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="/POM/4.0.0"
xmlns:xsi="http:///2001/XMLSchema-instance"
xsi:schemaLocation="/POM/4.0.0 /xsd/maven-4.0.">
<parent>
<artifactId>pro06-demo-ssm</artifactId>
<groupId></groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>demo-module02-component</artifactId>
<properties>
<>8</>
<>8</>
</properties>
<dependencies>
<dependency>
<groupId></groupId>
<artifactId>demo-module03-entity</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId></groupId>
<artifactId>demo-module04-util</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId></groupId>
<artifactId>demo-module05-environment</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- ServletAPI -->
<dependency>
<groupId></groupId>
<artifactId>-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
demo-module01-web module pow configuration: web project pow configuration
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="/POM/4.0.0"
xmlns:xsi="http:///2001/XMLSchema-instance"
xsi:schemaLocation="/POM/4.0.0 /xsd/maven-4.0.">
<parent>
<artifactId>pro06-demo-ssm</artifactId>
<groupId></groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>demo-module01-web</artifactId>
<packaging>war</packaging>
<properties>
<>8</>
<>8</>
</properties>
<dependencies>
<dependency>
<groupId></groupId>
<artifactId>demo-module02-component</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- junit5 -->
<dependency>
<groupId></groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.7.0</version>
<scope>test</scope>
</dependency>
<!-- Spring test function -->
<dependency>
<groupId></groupId>
<artifactId>spring-test</artifactId>
<version>5.3.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
The maven dependency view after all the pow configuration information and related dependencies have been configured for each project is as follows:
Corresponding to the previous section in the sequence: ✏️✏️✏️
The corresponding sequence is the next section: ✏️✏️✏️