1. 启动zookepper
2、构建工程
pom.xml 文件内容如下:
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>cn.kgc</groupId> 8 <artifactId>wf-2019-products</artifactId> 9 <packaging>pom</packaging> 10 <version>1.0-SNAPSHOT</version> 11 <modules> 12 <module>common</module> 13 </modules> 14 15 <name>wf-2019-products</name> 16 <!-- FIXME change it to the project's website --> 17 <url>http://www.example.com</url> 18 19 <properties> 20 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 21 <maven.compiler.source>1.7</maven.compiler.source> 22 <maven.compiler.target>1.7</maven.compiler.target> 23 </properties> 24 25 <dependencies> 26 <dependency> 27 <groupId>junit</groupId> 28 <artifactId>junit</artifactId> 29 <version>4.12</version> 30 </dependency> 31 32 <dependency> 33 <groupId>com.github.pagehelper</groupId> 34 <artifactId>pagehelper-spring-boot-starter</artifactId> 35 <version>1.2.3</version> 36 </dependency> 37 38 </dependencies> 39 40 <build> 41 <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --> 42 <plugins> 43 <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle --> 44 <plugin> 45 <artifactId>maven-clean-plugin</artifactId> 46 <version>3.1.0</version> 47 </plugin> 48 <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging --> 49 <plugin> 50 <artifactId>maven-resources-plugin</artifactId> 51 <version>3.0.2</version> 52 </plugin> 53 <plugin> 54 <artifactId>maven-compiler-plugin</artifactId> 55 <version>3.8.0</version> 56 </plugin> 57 <plugin> 58 <artifactId>maven-surefire-plugin</artifactId> 59 <version>2.22.1</version> 60 </plugin> 61 <plugin> 62 <artifactId>maven-jar-plugin</artifactId> 63 <version>3.0.2</version> 64 </plugin> 65 <plugin> 66 <artifactId>maven-install-plugin</artifactId> 67 <version>2.5.2</version> 68 </plugin> 69 <plugin> 70 <artifactId>maven-deploy-plugin</artifactId> 71 <version>2.8.2</version> 72 </plugin> 73 <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle --> 74 <plugin> 75 <artifactId>maven-site-plugin</artifactId> 76 <version>3.7.1</version> 77 </plugin> 78 <plugin> 79 <artifactId>maven-project-info-reports-plugin</artifactId> 80 <version>3.0.0</version> 81 </plugin> 82 </plugins> 83 </pluginManagement> 84 </build> 85 </project>
3.普通maven工程common的结构
3.1