第一步:整体项目zb_project的pom配置
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>zb-dubboDemo</groupId> 8 <artifactId>zb-Project</artifactId> 9 <packaging>pom</packaging> 10 <version>1.0-SNAPSHOT</version> 11 <modules> 12 <module>zb-common</module> 13 <module>zb-Server01</module> 14 <module>zb-web</module> 15 </modules> 16 17 <name>zb-Project</name> 18 <url>http://maven.apache.org</url> 19 20 <properties> 21 <java.version>1.8</java.version> 22 <java.encoding>utf-8</java.encoding> 23 <springframework.version>4.2.4.RELEASE</springframework.version> 24 <mybatis.version>3.3.1</mybatis.version> 25 <mybatis-spring.version>1.2.4</mybatis-spring.version> 26 <mysql.version>5.1.36</mysql.version> 27 <servlet.version>3.1.0</servlet.version> 28 <jedis.version>2.9.0</jedis.version> 29 <redisson.version>3.5.4</redisson.version> 30 <spring-data-redis.version>2.0.0.RELEASE</spring-data-redis.version> 31 <spring-session-data-redis.version>1.3.1.RELEASE</spring-session-data-redis.version> 32 <dubbo.version>2.5.5</dubbo.version> 33 <solr.version>7.1.0</solr.version> 34 <solr-spring-data.version>3.0.0.RELEASE</solr-spring-data.version> 35 <nexus.url>http://123.56.78.170:8082/nexus</nexus.url> 36 </properties> 37 38 <dependencies> 39 <!-- fastdfs --> 40 41 42 <!-- solr --> 43 <dependency> 44 <groupId>org.apache.solr</groupId> 45 <artifactId>solr-solrj</artifactId> 46 <version>4.10.1</version> 47 </dependency> 48 49 <dependency> 50 <groupId>org.springframework.data</groupId> 51 <artifactId>spring-data-solr</artifactId> 52 <version>${solr-spring-data.version}</version> 53 </dependency> 54 55 56 <dependency> 57 <groupId>javax.servlet</groupId> 58 <artifactId>jstl</artifactId> 59 <version>1.2</version> 60 </dependency> 61 62 <dependency> 63 <groupId>javax.servlet</groupId> 64 <artifactId>javax.servlet-api</artifactId> 65 <version>3.1.0</version> 66 </dependency> 67 68 <dependency> 69 <groupId>javax.servlet.jsp</groupId> 70 <artifactId>jsp-api</artifactId> 71 <version>2.1</version> 72 </dependency> 73 74 <!-- mysql 驱动start --> 75 <dependency> 76 <groupId>mysql</groupId> 77 <artifactId>mysql-connector-java</artifactId> 78 <version>${mysql.version}</version> 79 </dependency> 80 81 <dependency> 82 <groupId>org.mybatis</groupId> 83 <artifactId>mybatis-ehcache</artifactId> 84 <version>1.0.0</version> 85 </dependency> 86 87 <!-- mybatis分页插件 --> 88 <dependency> 89 <groupId>com.github.pagehelper</groupId> 90 <artifactId>pagehelper</artifactId> 91 <version>4.1.0</version> 92 </dependency> 93 94 <dependency> 95 <groupId>com.alibaba</groupId> 96 <artifactId>druid</artifactId> 97 <version>1.0.3</version> 98 </dependency> 99 100 <dependency> 101 <groupId>log4j</groupId> 102 <artifactId>log4j</artifactId> 103 <version>1.2.17</version> 104 </dependency> 105 106 <dependency> 107 <groupId>org.slf4j</groupId> 108 <artifactId>slf4j-log4j12</artifactId> 109 <version>1.7.12</version> 110 </dependency> 111 112 <!-- CGLIB --> 113 <dependency> 114 <groupId>cglib</groupId> 115 <artifactId>cglib-nodep</artifactId> 116 <version>2.1_3</version> 117 </dependency> 118 119 <dependency> 120 <groupId>junit</groupId> 121 <artifactId>junit</artifactId> 122 <version>4.12</version> 123 <scope>test</scope> 124 </dependency> 125 126 <dependency> 127 <groupId>org.json</groupId> 128 <artifactId>json</artifactId> 129 <version>20151123</version> 130 </dependency> 131 132 <!-- jdbc --> 133 <dependency> 134 <groupId>org.mybatis</groupId> 135 <artifactId>mybatis-spring</artifactId> 136 <version>${mybatis-spring.version}</version> 137 </dependency> 138 139 <dependency> 140 <groupId>org.mybatis</groupId> 141 <artifactId>mybatis</artifactId> 142 <version>${mybatis.version}</version> 143 </dependency> 144 <dependency> 145 <groupId>commons-io</groupId> 146 <artifactId>commons-io</artifactId> 147 <version>2.0.1</version> 148 </dependency> 149 150 <dependency> 151 <groupId>commons-logging</groupId> 152 <artifactId>commons-logging</artifactId> 153 <version>1.1.3</version> 154 </dependency> 155 156 <dependency> 157 <groupId>commons-codec</groupId> 158 <artifactId>commons-codec</artifactId> 159 <version>1.9</version> 160 </dependency> 161 162 <dependency> 163 <groupId>commons-validator</groupId> 164 <artifactId>commons-validator</artifactId> 165 <version>1.3.1</version> 166 </dependency> 167 168 <dependency> 169 <groupId>commons-digester</groupId> 170 <artifactId>commons-digester</artifactId> 171 <version>1.8</version> 172 </dependency> 173 174 <dependency> 175 <groupId>commons-lang</groupId> 176 <artifactId>commons-lang</artifactId> 177 <version>2.4</version> 178 </dependency> 179 180 <dependency> 181 <groupId>commons-beanutils</groupId> 182 <artifactId>commons-beanutils-core</artifactId> 183 <version>1.7.0</version> 184 </dependency> 185 186 <dependency> 187 <groupId>commons-collections</groupId> 188 <artifactId>commons-collections</artifactId> 189 <version>3.2.1</version> 190 </dependency> 191 192 <dependency> 193 <groupId>commons-fileupload</groupId> 194 <artifactId>commons-fileupload</artifactId> 195 <version>1.3.2</version> 196 </dependency> 197 198 <dependency> 199 <groupId>org.apache.commons</groupId> 200 <artifactId>commons-lang3</artifactId> 201 <version>3.5</version> 202 </dependency> 203 204 205 <!-- spring --> 206 <dependency> 207 <groupId>org.springframework</groupId> 208 <artifactId>spring-core</artifactId> 209 <version>${springframework.version}</version> 210 </dependency> 211 212 <dependency> 213 <groupId>org.springframework</groupId> 214 <artifactId>spring-beans</artifactId> 215 <version>${springframework.version}</version> 216 </dependency> 217 218 <dependency> 219 <groupId>org.springframework</groupId> 220 <artifactId>spring-context</artifactId> 221 <version>${springframework.version}</version> 222 </dependency> 223 224 <dependency> 225 <groupId>org.springframework</groupId> 226 <artifactId>spring-context-support</artifactId> 227 <version>${springframework.version}</version> 228 </dependency> 229 230 <dependency> 231 <groupId>org.springframework</groupId> 232 <artifactId>spring-test</artifactId> 233 <version>${springframework.version}</version> 234 <scope>test</scope> 235 </dependency> 236 237 <dependency> 238 <groupId>org.springframework</groupId> 239 <artifactId>spring-tx</artifactId> 240 <version>${springframework.version}</version> 241 </dependency> 242 243 <dependency> 244 <groupId>org.springframework</groupId> 245 <artifactId>spring-web</artifactId> 246 <version>${springframework.version}</version> 247 </dependency> 248 249 <dependency> 250 <groupId>org.springframework</groupId> 251 <artifactId>spring-webmvc</artifactId> 252 <version>${springframework.version}</version> 253 </dependency> 254 255 <dependency> 256 <groupId>org.springframework</groupId> 257 <artifactId>spring-aspects</artifactId> 258 <version>${springframework.version}</version> 259 </dependency> 260 261 <dependency> 262 <groupId>org.springframework</groupId> 263 <artifactId>spring-expression</artifactId> 264 <version>${springframework.version}</version> 265 </dependency> 266 267 <dependency> 268 <groupId>org.springframework</groupId> 269 <artifactId>spring-jdbc</artifactId> 270 <version>${springframework.version}</version> 271 </dependency> 272 273 <dependency> 274 <groupId>aopalliance</groupId> 275 <artifactId>aopalliance</artifactId> 276 <version>1.0</version> 277 </dependency> 278 279 <dependency> 280 <groupId>org.aspectj</groupId> 281 <artifactId>aspectjrt</artifactId> 282 <version>1.7.3</version> 283 </dependency> 284 <dependency> 285 <groupId>org.javassist</groupId> 286 <artifactId>javassist</artifactId> 287 <version>3.20.0-GA</version> 288 </dependency> 289 <dependency> 290 <groupId>org.aspectj</groupId> 291 <artifactId>aspectjweaver</artifactId> 292 <version>1.6.10</version> 293 <scope>runtime</scope> 294 </dependency> 295 296 <dependency> 297 <groupId>org.springframework</groupId> 298 <artifactId>spring-aop</artifactId> 299 <version>${springframework.version}</version> 300 <exclusions> 301 <exclusion> 302 <groupId>commons-logging</groupId> 303 <artifactId>commons-logging</artifactId> 304 </exclusion> 305 </exclusions> 306 </dependency> 307 <!--极光推送依赖 start--> 308 <dependency> 309 <groupId>cn.jpush.api</groupId> 310 <artifactId>jpush-client</artifactId> 311 <version>3.2.17</version> 312 </dependency> 313 <dependency> 314 <groupId>cn.jpush.api</groupId> 315 <artifactId>jiguang-common</artifactId> 316 <version>1.0.7</version> 317 </dependency> 318 <!--极光推送依赖 end--> 319 <!-- json依赖包 --> 320 <dependency> 321 <groupId>com.fasterxml.jackson.core</groupId> 322 <artifactId>jackson-core</artifactId> 323 <version>2.5.0</version> 324 </dependency> 325 326 <dependency> 327 <groupId>com.fasterxml.jackson.core</groupId> 328 <artifactId>jackson-databind</artifactId> 329 <version>2.5.0</version> 330 </dependency> 331 332 <dependency> 333 <groupId>com.fasterxml.jackson.core</groupId> 334 <artifactId>jackson-annotations</artifactId> 335 <version>2.5.0</version> 336 </dependency> 337 338 <dependency> 339 <groupId>com.alibaba</groupId> 340 <artifactId>fastjson</artifactId> 341 <version>1.2.4</version> 342 </dependency> 343 344 <!--dom4j--> 345 <dependency> 346 <groupId>dom4j</groupId> 347 <artifactId>dom4j</artifactId> 348 <version>1.6.1</version> 349 </dependency> 350 351 <dependency> 352 <groupId>jaxen</groupId> 353 <artifactId>jaxen</artifactId> 354 <version>1.1.1</version> 355 </dependency> 356 357 <dependency> 358 <groupId>commons-httpclient</groupId> 359 <artifactId>commons-httpclient</artifactId> 360 <version>3.0</version> 361 </dependency> 362 363 <dependency> 364 <groupId>org.apache.poi</groupId> 365 <artifactId>poi</artifactId> 366 <version>3.9</version> 367 </dependency> 368 369 <dependency> 370 <groupId>org.apache.poi</groupId> 371 <artifactId>poi-ooxml</artifactId> 372 <version>3.9</version> 373 </dependency> 374 375 <dependency> 376 <groupId>com.aliyun.oss</groupId> 377 <artifactId>aliyun-sdk-oss</artifactId> 378 <version>2.5.0</version> 379 </dependency> 380 381 <dependency> 382 <groupId>eu.bitwalker</groupId> 383 <artifactId>UserAgentUtils</artifactId> 384 <version>1.20</version> 385 </dependency> 386 387 <!-- freemarker begin --> 388 <dependency> 389 <groupId>org.freemarker</groupId> 390 <artifactId>freemarker</artifactId> 391 <version>2.3.20</version> 392 </dependency> 393 394 <!-- Dubbo --> 395 <dependency> 396 <groupId>com.alibaba</groupId> 397 <artifactId>dubbo</artifactId> 398 <version>${dubbo.version}</version> 399 <exclusions> 400 <exclusion> 401 <groupId>org.springframework</groupId> 402 <artifactId>spring</artifactId> 403 </exclusion> 404 <exclusion> 405 <groupId>org.jboss.netty</groupId> 406 <artifactId>netty</artifactId> 407 </exclusion> 408 </exclusions> 409 </dependency> 410 411 <dependency> 412 <groupId>com.101tec</groupId> 413 <artifactId>zkclient</artifactId> 414 <version>0.10</version> 415 <exclusions> 416 <exclusion> 417 <groupId>org.slf4j</groupId> 418 <artifactId>slf4j-log4j12</artifactId> 419 </exclusion> 420 </exclusions> 421 </dependency> 422 423 <dependency> 424 <groupId>io.netty</groupId> 425 <artifactId>netty-all</artifactId> 426 <version>4.1.16.Final</version> 427 </dependency> 428 429 <dependency> 430 <groupId>org.apache.zookeeper</groupId> 431 <artifactId>zookeeper</artifactId> 432 <version>3.4.10</version> 433 </dependency> 434 435 <dependency> 436 <groupId>com.netflix.curator</groupId> 437 <artifactId>curator-framework</artifactId> 438 <version>1.3.3</version> 439 </dependency> 440 441 <!-- 缓存 --> 442 <dependency> 443 <groupId>redis.clients</groupId> 444 <artifactId>jedis</artifactId> 445 <version>${jedis.version}</version> 446 </dependency> 447 448 <dependency> 449 <groupId>org.springframework.data</groupId> 450 <artifactId>spring-data-redis</artifactId> 451 <version>${spring-data-redis.version}</version> 452 </dependency> 453 454 <dependency> 455 <groupId>org.springframework.session</groupId> 456 <artifactId>spring-session-data-redis</artifactId> 457 <version>${spring-session-data-redis.version}</version> 458 </dependency> 459 460 <dependency> 461 <groupId>org.redisson</groupId> 462 <artifactId>redisson</artifactId> 463 <version>${redisson.version}</version> 464 </dependency> 465 466 <dependency> 467 <groupId>org.apache.velocity</groupId> 468 <artifactId>velocity</artifactId> 469 <version>1.7</version> 470 </dependency> 471 </dependencies> 472 473 474 <build> 475 <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --> 476 <plugins> 477 <plugin> 478 <artifactId>maven-clean-plugin</artifactId> 479 <version>3.0.0</version> 480 </plugin> 481 <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --> 482 <plugin> 483 <artifactId>maven-resources-plugin</artifactId> 484 <version>3.0.2</version> 485 </plugin> 486 <plugin> 487 <artifactId>maven-compiler-plugin</artifactId> 488 <version>3.7.0</version> 489 </plugin> 490 <plugin> 491 <artifactId>maven-surefire-plugin</artifactId> 492 <version>2.20.1</version> 493 </plugin> 494 <plugin> 495 <artifactId>maven-jar-plugin</artifactId> 496 <version>3.0.2</version> 497 </plugin> 498 <plugin> 499 <artifactId>maven-install-plugin</artifactId> 500 <version>2.5.2</version> 501 </plugin> 502 <plugin> 503 <artifactId>maven-deploy-plugin</artifactId> 504 <version>2.8.2</version> 505 </plugin> 506 </plugins> 507 </pluginManagement> 508 </build> 509 </project>
第二步:公共工具的子项目zb-common的pom配置
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <artifactId>zb-Project</artifactId> <groupId>zb-dubboDemo</groupId> <version>1.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>zb-common</artifactId> <name>zb-common</name> <packaging>jar</packaging> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.target>1.7</maven.compiler.target> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>commons-cli</groupId> <artifactId>commons-cli</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.3</version> </dependency> <dependency> <groupId>org.openoffice</groupId> <artifactId>juh</artifactId> <version>3.0.1</version> </dependency> <dependency> <groupId>org.openoffice</groupId> <artifactId>jurt</artifactId> <version>3.0.1</version> </dependency> <dependency> <groupId>org.openoffice</groupId> <artifactId>ridl</artifactId> <version>3.0.1</version> </dependency> <!--<dependency>--> <!--<groupId>org.slf4j</groupId>--> <!--<artifactId>slf4j-jdk14</artifactId>--> <!--<version>1.5.6</version>--> <!--</dependency>--> <dependency> <groupId>org.openoffice</groupId> <artifactId>unoil</artifactId> <version>3.0.1</version> </dependency> <dependency> <groupId>com.thoughtworks.xstream</groupId> <artifactId>xstream</artifactId> <version>1.3.1</version> </dependency> <dependency> <groupId>com.artofsolving</groupId> <artifactId>jodconverter</artifactId> <version>2.2.1</version> <exclusions> <exclusion> <artifactId>slf4j-api</artifactId> <groupId>org.slf4j</groupId> </exclusion> </exclusions> </dependency> </dependencies> <build> <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --> <plugins> <plugin> <artifactId>maven-clean-plugin</artifactId> <version>3.0.0</version> </plugin> <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --> <plugin> <artifactId>maven-resources-plugin</artifactId> <version>3.0.2</version> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.7.0</version> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.20.1</version> </plugin> <plugin> <artifactId>maven-jar-plugin</artifactId> <version>3.0.2</version> </plugin> <plugin> <artifactId>maven-install-plugin</artifactId> <version>2.5.2</version> </plugin> <plugin> <artifactId>maven-deploy-plugin</artifactId> <version>2.8.2</version> </plugin> </plugins> </pluginManagement> </build> </project>
第三布:server子项目配置
<1.server-entity(server中存放逆向工程生成的实体,mapper接口,mapper.xml)
<2.server-service(存放服务接口)
<3.server-serviceImpl(存放服务接口实现)