|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | + |
| 3 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 4 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| 5 | + <modelVersion>4.0.0</modelVersion> |
| 6 | + |
| 7 | + <groupId>edu.heuet.android.shaohua</groupId> |
| 8 | + <artifactId>shaohua-backend</artifactId> |
| 9 | + <version>1.0</version> |
| 10 | + |
| 11 | + <name>shaohua-backend</name> |
| 12 | + <!-- FIXME change it to the project's website --> |
| 13 | + <url>http://www.example.com</url> |
| 14 | + |
| 15 | + <!-- 1、引入的第一个:导入springmvc、spring-aop之类的jar包 --> |
| 16 | + <parent> |
| 17 | + <groupId>org.springframework.boot</groupId> |
| 18 | + <artifactId>spring-boot-starter-parent</artifactId> |
| 19 | + <version>2.1.4.RELEASE</version> |
| 20 | + </parent> |
| 21 | + |
| 22 | + <properties> |
| 23 | + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| 24 | + <maven.compiler.source>1.8</maven.compiler.source> |
| 25 | + <maven.compiler.target>1.8</maven.compiler.target> |
| 26 | + </properties> |
| 27 | + |
| 28 | + <dependencies> |
| 29 | + <dependency> |
| 30 | + <groupId>junit</groupId> |
| 31 | + <artifactId>junit</artifactId> |
| 32 | + <version>4.11</version> |
| 33 | + <scope>test</scope> |
| 34 | + </dependency> |
| 35 | + <!-- 2、 引入的第二个:导入一些web相关的jar包 --> |
| 36 | + <dependency> |
| 37 | + <groupId>org.springframework.boot</groupId> |
| 38 | + <artifactId>spring-boot-starter-web</artifactId> |
| 39 | + </dependency> |
| 40 | + <!-- 3、 引入的第三个:java连接mysql的connector的jar包 --> |
| 41 | + <dependency> |
| 42 | + <groupId>mysql</groupId> |
| 43 | + <artifactId>mysql-connector-java</artifactId> |
| 44 | + <version>5.1.41</version> |
| 45 | + </dependency> |
| 46 | + <!-- 4、引入的第四个:阿里的德鲁伊连接池,管理mysql连接的jar包 --> |
| 47 | + <dependency> |
| 48 | + <groupId>com.alibaba</groupId> |
| 49 | + <artifactId>druid</artifactId> |
| 50 | + <version>1.1.3</version> |
| 51 | + </dependency> |
| 52 | + <!-- 5、引入的第五个:Mybatis相关的jar包 --> |
| 53 | + <dependency> |
| 54 | + <groupId>org.mybatis.spring.boot</groupId> |
| 55 | + <artifactId>mybatis-spring-boot-starter</artifactId> |
| 56 | + <version>1.3.1</version> |
| 57 | + </dependency> |
| 58 | + |
| 59 | + <!-- 11、Apache commons--> |
| 60 | + <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 --> |
| 61 | + <dependency> |
| 62 | + <groupId>org.apache.commons</groupId> |
| 63 | + <artifactId>commons-lang3</artifactId> |
| 64 | + <version>3.4</version> |
| 65 | + </dependency> |
| 66 | + |
| 67 | + <!-- 12、hibernate validator --> |
| 68 | + <!-- https://mvnrepository.com/artifact/org.hibernate.validator/hibernate-validator --> |
| 69 | + <dependency> |
| 70 | + <groupId>org.hibernate.validator</groupId> |
| 71 | + <artifactId>hibernate-validator</artifactId> |
| 72 | + <version>6.0.13.Final</version> |
| 73 | + </dependency> |
| 74 | + |
| 75 | + <!-- 13、Log --> |
| 76 | + <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api --> |
| 77 | + <dependency> |
| 78 | + <groupId>org.slf4j</groupId> |
| 79 | + <artifactId>slf4j-api</artifactId> |
| 80 | + <version>1.7.25</version> |
| 81 | + </dependency> |
| 82 | + <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-log4j12 --> |
| 83 | + <dependency> |
| 84 | + <groupId>org.slf4j</groupId> |
| 85 | + <artifactId>slf4j-log4j12</artifactId> |
| 86 | + <version>1.7.25</version> |
| 87 | + <!-- <scope>test</scope> --> |
| 88 | + </dependency> |
| 89 | + <dependency> |
| 90 | + <groupId>mysql</groupId> |
| 91 | + <artifactId>mysql-connector-java</artifactId> |
| 92 | + <version>8.0.21</version> |
| 93 | + </dependency> |
| 94 | + <dependency> |
| 95 | + <groupId>org.mybatis.generator</groupId> |
| 96 | + <artifactId>mybatis-generator-core</artifactId> |
| 97 | + <version>1.3.5</version> |
| 98 | + </dependency> |
| 99 | + </dependencies> |
| 100 | + |
| 101 | + <build> |
| 102 | + <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --> |
| 103 | + <plugins> |
| 104 | + <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle --> |
| 105 | + <plugin> |
| 106 | + <artifactId>maven-clean-plugin</artifactId> |
| 107 | + <version>3.1.0</version> |
| 108 | + </plugin> |
| 109 | + <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --> |
| 110 | + <plugin> |
| 111 | + <artifactId>maven-resources-plugin</artifactId> |
| 112 | + <version>3.0.2</version> |
| 113 | + </plugin> |
| 114 | + <plugin> |
| 115 | + <artifactId>maven-compiler-plugin</artifactId> |
| 116 | + <version>3.8.0</version> |
| 117 | + </plugin> |
| 118 | + <plugin> |
| 119 | + <artifactId>maven-surefire-plugin</artifactId> |
| 120 | + <version>2.22.1</version> |
| 121 | + </plugin> |
| 122 | + <plugin> |
| 123 | + <artifactId>maven-jar-plugin</artifactId> |
| 124 | + <version>3.0.2</version> |
| 125 | + </plugin> |
| 126 | + <plugin> |
| 127 | + <artifactId>maven-install-plugin</artifactId> |
| 128 | + <version>2.5.2</version> |
| 129 | + </plugin> |
| 130 | + <plugin> |
| 131 | + <artifactId>maven-deploy-plugin</artifactId> |
| 132 | + <version>2.8.2</version> |
| 133 | + </plugin> |
| 134 | + <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle --> |
| 135 | + <plugin> |
| 136 | + <artifactId>maven-site-plugin</artifactId> |
| 137 | + <version>3.7.1</version> |
| 138 | + </plugin> |
| 139 | + <plugin> |
| 140 | + <artifactId>maven-project-info-reports-plugin</artifactId> |
| 141 | + <version>3.0.0</version> |
| 142 | + </plugin> |
| 143 | + |
| 144 | + <!-- 6、第六个引入的:mybatis的相关插件 --> |
| 145 | + <plugin> |
| 146 | + <groupId>org.mybatis.generator</groupId> |
| 147 | + <artifactId>mybatis-generator-maven-plugin</artifactId> |
| 148 | + <version>1.3.5</version> |
| 149 | + <!-- 注意这里plugin下的dependencies,Maven是无法识别的 --> |
| 150 | + <!-- 比较骚的操作就是,先把下面的dependency放到外面project下面的dependencies --> |
| 151 | + <!-- 然后去右侧工具条Maven执行Reimport,最后再把这些dependency放回来,再进行Reimport,来导入mybatis的插件 --> |
| 152 | + <dependencies> |
| 153 | + <!-- 7、 第七个引入的:mybatis生成器的core相关jar包 --> |
| 154 | + <dependency> |
| 155 | + <groupId>org.mybatis.generator</groupId> |
| 156 | + <artifactId>mybatis-generator-core</artifactId> |
| 157 | + <version>1.3.5</version> |
| 158 | + </dependency> |
| 159 | + <!-- 8、 在mybatis的插件里再引入一遍mysql的连接jar包 --> |
| 160 | + <!-- 上面曾经引入过,是服务端java代码与mysql连接 --> |
| 161 | + <!-- 这里再次声明,是mybatis插件和mysql连接 --> |
| 162 | + <!-- 虽说老师这么写了, 但我个人觉得没必要重复引入jar包啊 --> |
| 163 | + <!-- 老师给出的解释是:要生成的mybatis插件,需要借助相关的依赖 --> |
| 164 | + <dependency> |
| 165 | + <groupId>mysql</groupId> |
| 166 | + <artifactId>mysql-connector-java</artifactId> |
| 167 | + <version>8.0.21</version> |
| 168 | + </dependency> |
| 169 | + </dependencies> |
| 170 | + <!-- executions : 执行--> |
| 171 | + <!-- 9、配置mybatis generator 插件的执行阶段phase以及执行目的goal --> |
| 172 | + <executions> |
| 173 | + <execution> |
| 174 | + <id>mybatis generator</id> |
| 175 | + <phase>package</phase> |
| 176 | + <goals> |
| 177 | + <goal>generate</goal> |
| 178 | + </goals> |
| 179 | + </execution> |
| 180 | + </executions> |
| 181 | + <!-- 10、mybatis generator 插件的相关属性配置 --> |
| 182 | + <configuration> |
| 183 | + <!-- verbose : 冗余的 , 允许移动生成的文件 --> |
| 184 | + <verbose>true</verbose> |
| 185 | + <!-- 新生成的覆盖旧生成的,实际工作中慎用 --> |
| 186 | + <overwrite>true</overwrite> |
| 187 | + <!-- 指定mybatis配置文件的路径 --> |
| 188 | + <configurationFile>src/main/resources/mybatis-generator.xml</configurationFile> |
| 189 | + </configuration> |
| 190 | + |
| 191 | + </plugin> |
| 192 | + |
| 193 | + |
| 194 | + </plugins> |
| 195 | + </pluginManagement> |
| 196 | + <plugins> |
| 197 | + <plugin> |
| 198 | + <groupId>org.apache.maven.plugins</groupId> |
| 199 | + <artifactId>maven-compiler-plugin</artifactId> |
| 200 | + <configuration> |
| 201 | + <source>8</source> |
| 202 | + <target>8</target> |
| 203 | + </configuration> |
| 204 | + </plugin> |
| 205 | + </plugins> |
| 206 | + </build> |
| 207 | +</project> |
0 commit comments