maven-parent的使用,包含springboot的parent一起依赖

赵智勇
2023-12-01

spring-boot-starter-parent这个POM比较好用,里面包含大部分常用的开发所需的jar包。
今天我在此基础上配置自己额外的jar包,使子工程便于依赖

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">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.lee</groupId>
	<artifactId>junli_parent</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>pom</packaging>
	<!-- <name>基础依赖版本管理</name> -->
	<!-- <url>http://maven.apache.org</url> -->

	<!-- 引入SpringBoot父类依赖 -->
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.0.5.RELEASE</version>
		<relativePath />
		<!-- lookup parent from repository -->
	</parent>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<java.version>1.8</java.version>
		<mybatis-generator.version>1.3.7</mybatis-generator.version>
		<mysql.version>5.1.13</mysql.version>
		<oracle.version>12.2.0.1</oracle.version>
		<mybatis.version>3.2.4</mybatis.version>
		<org.apache.poi.version>3.15</org.apache.poi.version>
		<apache-httpclient.version>3.1</apache-httpclient.version>
		<zookeeper.version>3.4.13</zookeeper.version>
		<zkclient.version>0.10</zkclient.version>
		<jedis.version>2.9.2</jedis.version>
		<dubbo.version>2.5.9</dubbo.version>
		<activemq-all.version>5.9.1</activemq-all.version>
		<solr.version>7.5.0</solr.version>
		<javax.el-api.version>3.0.0</javax.el-api.version>
		<fastjson.version>1.2.9</fastjson.version>
		<druid.version>1.1.9</druid.version>
		<ikanalyzer.version>2012_u6</ikanalyzer.version>
		<jsch.version>0.1.54</jsch.version>
		<commons-io.version>2.4</commons-io.version>
		<ik-analyzer-solr7.version>7.x</ik-analyzer-solr7.version>
		<mybatis-spring-boot-starter.version>1.3.0</mybatis-spring-boot-starter.version>
		<aopalliance.version>1.0</aopalliance.version>
		<org.apache.commons.codec.version>1.8</org.apache.commons.codec.version>
		<commons-fileupload.version>1.3.3</commons-fileupload.version>
		<jxl.version>2.6.10</jxl.version>
		<sigar.version>1.6.4</sigar.version>
		<json-lib.version>2.4</json-lib.version>
		<xom.version>1.2.5</xom.version>
		<pagehelper-version>5.1.7</pagehelper-version>
	</properties>

	<dependencyManagement>
		<dependencies>
			<!-- pagehelper分页插件 -->
			<dependency>
				<groupId>com.github.pagehelper</groupId>
				<artifactId>pagehelper</artifactId>
				<version>${pagehelper-version}</version>
			</dependency>

			<!-- EL表达式 -->
			<dependency>
				<groupId>javax.el</groupId>
				<artifactId>javax.el-api</artifactId>
				<version>${javax.el-api.version}</version>
			</dependency>

			<!-- ikanalyzer中文分词器 -->
			<dependency>
				<groupId>com.janeluo</groupId>
				<artifactId>ikanalyzer</artifactId>
				<version>${ikanalyzer.version}</version>
			</dependency>
			<!-- ikanalyzer中文分词器对solr7版本的支持 -->
			<dependency>
				<groupId>com.github.magese</groupId>
				<artifactId>ik-analyzer-solr7</artifactId>
				<version>${ik-analyzer-solr7.version}</version>
			</dependency>
			<!--   导入solrJ依赖 -->
			<dependency>
				<groupId>org.apache.solr</groupId>
				<artifactId>solr-solrj</artifactId>
				<version>${solr.version}</version>
			</dependency>

			<!-- ActiveMQ支持 -->
			<dependency>
				<groupId>org.apache.activemq</groupId>
				<artifactId>activemq-all</artifactId>
				<version>${activemq-all.version}</version>
			</dependency>

			<!-- dubbo服务 -->
			<dependency>
				<groupId>com.alibaba</groupId>
				<artifactId>dubbo</artifactId>
				<version>${dubbo.version}</version>
				<!-- <exclusions> -->
				<!-- <exclusion> -->
				<!-- <artifactId>spring</artifactId> -->
				<!-- <groupId>org.springframework</groupId> -->
				<!-- </exclusion> -->
				<!-- </exclusions> -->
			</dependency>
			<!-- jedis工具包 -->
			<dependency>
				<groupId>com.github.sazzad16</groupId>
				<artifactId>jedis</artifactId>
				<version>${jedis.version}</version>
			</dependency>

			<!-- springboot安全认证模块 -->
			<!-- <dependency> -->
			<!-- <groupId>org.springframework.boot</groupId> -->
			<!-- <artifactId>spring-boot-starter-security</artifactId> -->
			<!-- </dependency> -->
			<!-- springboot集成mybatis -->
			<dependency>
				<groupId>org.mybatis.spring.boot</groupId>
				<artifactId>mybatis-spring-boot-starter</artifactId>
				<version>${mybatis-spring-boot-starter.version}</version>
			</dependency>
			<!-- 阿里Druid连接池 -->
			<dependency>
				<groupId>com.alibaba</groupId>
				<artifactId>druid</artifactId>
				<version>${druid.version}</version>
			</dependency>
			<!-- zookeeper套件 -->
			<dependency>
				<groupId>org.apache.zookeeper</groupId>
				<artifactId>zookeeper</artifactId>
				<version>${zookeeper.version}</version>
				<!-- <exclusions> -->
				<!-- <exclusion> -->
				<!-- <groupId>org.slf4j</groupId> -->
				<!-- <artifactId>slf4j-log4j12</artifactId> -->
				<!-- </exclusion> -->
				<!-- <exclusion> -->
				<!-- <groupId>log4j</groupId> -->
				<!-- <artifactId>log4j</artifactId> -->
				<!-- </exclusion> -->
				<!-- </exclusions> -->
			</dependency>
			<dependency>
				<groupId>com.101tec</groupId>
				<artifactId>zkclient</artifactId>
				<version>${zkclient.version}</version>
				<!-- <exclusions> -->
				<!-- <exclusion> -->
				<!-- <groupId>org.slf4j</groupId> -->
				<!-- <artifactId>slf4j-log4j12</artifactId> -->
				<!-- </exclusion> -->
				<!-- <exclusion> -->
				<!-- <groupId>log4j</groupId> -->
				<!-- <artifactId>log4j</artifactId> -->
				<!-- </exclusion> -->
				<!-- </exclusions> -->
			</dependency>

			<!-- 阿里JSON工具 -->
			<dependency>
				<groupId>com.alibaba</groupId>
				<artifactId>fastjson</artifactId>
				<version>${fastjson.version}</version>
			</dependency>
			<!-- base64工具包 -->
			<dependency>
				<groupId>org.apache.directory.studio</groupId>
				<artifactId>org.apache.commons.codec</artifactId>
				<version>${org.apache.commons.codec.version}</version>
			</dependency>
			<!-- google.guava工具包 -->
			<!-- <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> 
				<version>r07</version> </dependency> -->


			<!-- Spring 4.3.3 -->
			<!-- Core Container 核心容器 -->
			<!-- 核心工具类,Spring其它模块大量使用Spring-core -->
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-test</artifactId>
				<version>4.3.3.RELEASE</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-core</artifactId>
				<version>4.3.3.RELEASE</version>
			</dependency>
			<!-- 运行时Spring容器 -->
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-context</artifactId>
				<version>4.3.3.RELEASE</version>
			</dependency>
			<!-- Spring容器对第三方包的集成 -->
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-context-support</artifactId>
				<version>4.3.3.RELEASE</version>
			</dependency>
			<!-- Spring定义Bean的支持 -->
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-beans</artifactId>
				<version>4.3.3.RELEASE</version>
			</dependency>
			<!-- 使用表达式语言在运行时查询和操作对象 -->
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-expression</artifactId>
				<version>4.3.3.RELEASE</version>
			</dependency>
			<!-- End Core Container 核心容器 -->

			<!-- AOP -->
			<!-- 基于代理的AOP支持 -->
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-aop</artifactId>
				<version>4.3.3.RELEASE</version>
			</dependency>
			<!-- 基于AspectJ的AOP支持 -->
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-aspects</artifactId>
				<version>4.3.3.RELEASE</version>
			</dependency>

			<!-- 处理事务和AOP所需的包 -->
			<dependency>
				<groupId>aopalliance</groupId>
				<artifactId>aopalliance</artifactId>
				<version>${aopalliance.version}</version>
			</dependency>

			<!-- web -->
			<!-- 提供基础的web集成的功能,在web项目中提供Spring容器 -->
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-web</artifactId>
				<version>4.3.3.RELEASE</version>
			</dependency>
			<!-- 提供基于Servlet的SpringMVC -->
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-webmvc</artifactId>
				<version>4.3.3.RELEASE</version>
			</dependency>
			<!-- 提供WebSocket功能 -->
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-websocket</artifactId>
				<version>4.3.3.RELEASE</version>
			</dependency>
			<!-- 提供Portlet环境支持 -->
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-webmvc-portlet</artifactId>
				<version>4.3.3.RELEASE</version>
			</dependency>
			<!-- End web -->

			<!-- DataAccess/Integration 数据访问/集成 -->
			<!-- 提供以JDBC访问数据库的支持 -->
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-jdbc</artifactId>
				<version>4.3.3.RELEASE</version>
			</dependency>
			<!-- 提供编程式和声明式的事务支持 -->
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-tx</artifactId>
				<version>4.3.3.RELEASE</version>
			</dependency>
			<!-- 提供对 对象/关系映射技术的支持 -->
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-orm</artifactId>
				<version>4.3.3.RELEASE</version>
			</dependency>
			<!-- 提供对JMS的支持 -->
			<dependency>
				<groupId>org.springframework</groupId>
				<artifactId>spring-jms</artifactId>
				<version>4.3.3.RELEASE</version>
			</dependency>
			<!-- End DataAccess/Integration 数据访问/集成 -->


			<!-- 文件上传管理 -->
			<dependency>
				<groupId>commons-io</groupId>
				<artifactId>commons-io</artifactId>
				<version>${commons-io.version}</version>
			</dependency>
			<dependency>
				<groupId>commons-fileupload</groupId>
				<artifactId>commons-fileupload</artifactId>
				<version>${commons-fileupload.version}</version>
				<!-- <exclusions> -->
				<!-- <exclusion> -->
				<!-- <groupId>commons-io</groupId> -->
				<!-- <artifactId>commons-io</artifactId> -->
				<!-- </exclusion> -->
				<!-- </exclusions> -->
			</dependency>
			<!-- 引入poi,解析workbook视图 -->
			<dependency>
				<groupId>org.apache.poi</groupId>
				<artifactId>poi-examples</artifactId>
				<version>${org.apache.poi.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.poi</groupId>
				<artifactId>poi-scratchpad</artifactId>
				<version>${org.apache.poi.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.poi</groupId>
				<artifactId>poi-excelant</artifactId>
				<version>${org.apache.poi.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.poi</groupId>
				<artifactId>poi-ooxml-schemas</artifactId>
				<version>${org.apache.poi.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.poi</groupId>
				<artifactId>poi-ooxml</artifactId>
				<version>${org.apache.poi.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.poi</groupId>
				<artifactId>poi</artifactId>
				<version>${org.apache.poi.version}</version>
			</dependency>
			<!-- 处理excel和上面功能是一样的 -->
			<dependency>
				<groupId>net.sourceforge.jexcelapi</groupId>
				<artifactId>jxl</artifactId>
				<version>${jxl.version}</version>
			</dependency>
			<!-- Mybatis代码生成工具 -->
			<dependency>
				<groupId>org.mybatis.generator</groupId>
				<artifactId>mybatis-generator-core</artifactId>
				<version>${mybatis-generator.version}</version>
			</dependency>

			<!-- Oracle连接 -->
			<dependency>
				<groupId>com.github.noraui</groupId>
				<artifactId>ojdbc8</artifactId>
				<version>${oracle.version}</version>
			</dependency>
			<!-- 获取本地计算机信息 -->
			<dependency>
				<groupId>com.github.votoanthuan</groupId>
				<artifactId>sigar</artifactId>
				<version>${sigar.version}</version>
			</dependency>
			<!-- JSON字符串和java对象的互转 -->
			<dependency>
				<groupId>net.sf.json-lib</groupId>
				<artifactId>json-lib</artifactId>
				<version>${json-lib.version}</version>
				<classifier>jdk15</classifier>
			</dependency>
			<!-- XML工具包 -->
			<dependency>
				<groupId>xom</groupId>
				<artifactId>xom</artifactId>
				<version>${xom.version}</version>
			</dependency>
			<dependency>
				<groupId>apache-httpclient</groupId>
				<artifactId>commons-httpclient</artifactId>
				<version>${apache-httpclient.version}</version>
			</dependency>

			<!-- java控制远程ssh,JAVA使用JSCH实现SFTP文件管理(上传、下载等) -->
			<dependency>
				<groupId>com.jcraft</groupId>
				<artifactId>jsch</artifactId>
				<version>${jsch.version}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<finalName>${project.artifactId}</finalName>
		<plugins>
			<!-- 资源文件拷贝插件 -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<!-- <version>2.7</version> -->
				<configuration>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			<!-- java编译插件 -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<!-- <version>3.2</version> -->
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
		</plugins>
		<!-- 插件版本的管理 pluginManagement 控制版本的,如果要使用,需要在子工程再配置坐标 -->
		<pluginManagement>
			<plugins>
				<!-- 配置Tomcat插件 -->
				<plugin>
					<groupId>org.apache.tomcat.maven</groupId>
					<artifactId>tomcat7-maven-plugin</artifactId>
					<version>2.2</version>
				</plugin>

				<!-- 配置打包时跳过测试 ,首次配置使用的时候会自动联网进行下载 -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.12.4</version>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
</project>

子工程的POM文件配置(例)

<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">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.lee</groupId>
	<artifactId>junli_web</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>war</packaging>
	<!-- 引入父类依赖 -->
	<parent>
		<groupId>com.lee</groupId>
		<artifactId>junli_parent</artifactId>
		<version>0.0.1-SNAPSHOT</version>
		<relativePath />
		<!-- lookup parent from repository -->
	</parent>
	<dependencies>
		<!-- 引入bean依赖 -->
		<dependency>
			<groupId>com.lee</groupId>
			<artifactId>junli_manager_bean</artifactId>
			<version>0.0.1-SNAPSHOT</version>
		</dependency>
		<!-- 引入base依赖 -->
		<dependency>
			<groupId>com.lee</groupId>
			<artifactId>junli_manager_base</artifactId>
			<version>0.0.1-SNAPSHOT</version>
		</dependency>
		<!-- 引入dao依赖 -->
		<dependency>
			<groupId>com.lee</groupId>
			<artifactId>junli_manager_dao</artifactId>
			<version>0.0.1-SNAPSHOT</version>
		</dependency>
		<!-- 引入interface依赖 -->
		<dependency>
			<groupId>com.lee</groupId>
			<artifactId>junli_manager_interface</artifactId>
			<version>0.0.1-SNAPSHOT</version>
		</dependency>
		<!-- netty -->
		<!-- <dependency>
			<groupId>io.netty</groupId>
			<artifactId>netty</artifactId>
		</dependency> -->

	<!-- quartz定时任务 -->
	<dependency>
		<groupId>org.quartz-scheduler</groupId>
		<artifactId>quartz</artifactId>
	</dependency>
	<dependency>
		<groupId>org.quartz-scheduler</groupId>
		<artifactId>quartz-jobs</artifactId>
	</dependency>

	<!-- pagehelper分页插件 -->
	<dependency>
		<groupId>com.github.pagehelper</groupId>
		<artifactId>pagehelper</artifactId>
	</dependency>

	<!-- freemarker模板引擎 -->
	<dependency>
		<groupId>org.freemarker</groupId>
		<artifactId>freemarker</artifactId>
	</dependency>

	<!-- 日志 -->
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter</artifactId>
		<exclusions>
			<exclusion>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-starter-logging</artifactId>
			</exclusion>
		</exclusions>
		<!--使用下面这个和上面排除spring-boot-starter-logging是一样的效果 <exclusions> <exclusion> 
			<artifactId>logback-classic</artifactId> <groupId>ch.qos.logback</groupId> 
			</exclusion> <exclusion> <artifactId>log4j-over-slf4j</artifactId> <groupId>org.slf4j</groupId> 
			</exclusion> </exclusions> -->
	</dependency>
	<dependency>
		<groupId>org.slf4j</groupId>
		<artifactId>slf4j-api</artifactId>
	</dependency>
	<dependency>
		<groupId>org.slf4j</groupId>
		<artifactId>slf4j-log4j12</artifactId>
	</dependency>

	<!-- 打war包时加入此项, 告诉spring-boot tomcat相关jar包用外部的,不要打进去 -->
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-tomcat</artifactId>
		<scope>provided</scope>
	</dependency>

	<!-- EL表达式 -->
	<dependency>
		<groupId>javax.el</groupId>
		<artifactId>javax.el-api</artifactId>
		<version>${javax.el-api.version}</version>
	</dependency>

	<dependency>
		<groupId>javax.validation</groupId>
		<artifactId>validation-api</artifactId>
		<!-- <version>2.0.0.Alpha1</version> -->
	</dependency>

	<!-- ikanalyzer中文分词器 -->
	<dependency>
		<groupId>com.janeluo</groupId>
		<artifactId>ikanalyzer</artifactId>
		<version>${ikanalyzer.version}</version>
	</dependency>
	<!-- ikanalyzer中文分词器对solr7版本的支持 -->
	<dependency>
		<groupId>com.github.magese</groupId>
		<artifactId>ik-analyzer-solr7</artifactId>
		<version>${ik-analyzer-solr7.version}</version>
	</dependency>
	<!--   导入solrJ依赖 -->
	<dependency>
		<groupId>org.apache.solr</groupId>
		<artifactId>solr-solrj</artifactId>
		<version>${solr.version}</version>
	</dependency>

	<!-- ActiveMQ支持 -->
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-jms</artifactId>
	</dependency>
	<dependency>
		<groupId>org.apache.activemq</groupId>
		<artifactId>activemq-all</artifactId>
		<version>${activemq-all.version}</version>
	</dependency>

	<!-- dubbo服务 -->
	<dependency>
		<groupId>com.alibaba</groupId>
		<artifactId>dubbo</artifactId>
		<exclusions>
			<exclusion>
				<groupId>org.springframework</groupId>
				<artifactId>spring</artifactId>
			</exclusion>
			<exclusion>
				<groupId>org.jboss.netty</groupId>
				<artifactId>netty</artifactId>
			</exclusion>
		</exclusions>
	</dependency>
	<!-- jedis工具包 -->
	<dependency>
		<groupId>com.github.sazzad16</groupId>
		<artifactId>jedis</artifactId>
		<version>${jedis.version}</version>
	</dependency>

	<!-- springboot整合web应用 -->
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-web</artifactId>
	</dependency>
	<!-- springboot安全认证模块 -->
	<!-- <dependency> -->
	<!-- <groupId>org.springframework.boot</groupId> -->
	<!-- <artifactId>spring-boot-starter-security</artifactId> -->
	<!-- </dependency> -->
	<!-- spring-boot停止服务功能 -->
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-test</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-jdbc</artifactId>
	</dependency>
	<!-- springboot集成mybatis -->
	<dependency>
		<groupId>org.mybatis.spring.boot</groupId>
		<artifactId>mybatis-spring-boot-starter</artifactId>
		<version>${mybatis-spring-boot-starter.version}</version>
	</dependency>
	<!-- 阿里Druid连接池 -->
	<dependency>
		<groupId>com.alibaba</groupId>
		<artifactId>druid</artifactId>
		<version>${druid.version}</version>
	</dependency>
	<!-- zookeeper套件 -->
	<dependency>
		<groupId>org.apache.zookeeper</groupId>
		<artifactId>zookeeper</artifactId>
		<version>${zookeeper.version}</version>
		<!-- <exclusions> -->
		<!-- <exclusion> -->
		<!-- <groupId>org.slf4j</groupId> -->
		<!-- <artifactId>slf4j-log4j12</artifactId> -->
		<!-- </exclusion> -->
		<!-- <exclusion> -->
		<!-- <groupId>log4j</groupId> -->
		<!-- <artifactId>log4j</artifactId> -->
		<!-- </exclusion> -->
		<!-- </exclusions> -->
	</dependency>
	<dependency>
		<groupId>com.101tec</groupId>
		<artifactId>zkclient</artifactId>
		<version>${zkclient.version}</version>
		<!-- <exclusions> -->
		<!-- <exclusion> -->
		<!-- <groupId>org.slf4j</groupId> -->
		<!-- <artifactId>slf4j-log4j12</artifactId> -->
		<!-- </exclusion> -->
		<!-- <exclusion> -->
		<!-- <groupId>log4j</groupId> -->
		<!-- <artifactId>log4j</artifactId> -->
		<!-- </exclusion> -->
		<!-- </exclusions> -->
	</dependency>

	<!-- 阿里JSON工具 -->
	<dependency>
		<groupId>com.alibaba</groupId>
		<artifactId>fastjson</artifactId>
		<version>${fastjson.version}</version>
	</dependency>
	<!-- base64工具包 -->
	<dependency>
		<groupId>org.apache.directory.studio</groupId>
		<artifactId>org.apache.commons.codec</artifactId>
		<version>${org.apache.commons.codec.version}</version>
	</dependency>
	<!-- Junit测试 -->
	<dependency>
		<groupId>junit</groupId>
		<artifactId>junit</artifactId>
		<scope>provided</scope>
	</dependency>
	<!-- JSTL标签库 -->
	<dependency>
		<groupId>javax.servlet</groupId>
		<artifactId>jstl</artifactId>
	</dependency>
	<!-- google.guava工具包 -->
	<!-- <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> 
		<version>r07</version> </dependency> -->


	<!-- Spring 4.3.3 -->
	<!-- Core Container 核心容器 -->
	<!-- 核心工具类,Spring其它模块大量使用Spring-core -->
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-test</artifactId>
		<version>4.3.3.RELEASE</version>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-core</artifactId>
		<version>4.3.3.RELEASE</version>
	</dependency>
	<!-- 运行时Spring容器 -->
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-context</artifactId>
		<version>4.3.3.RELEASE</version>
	</dependency>
	<!-- Spring容器对第三方包的集成 -->
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-context-support</artifactId>
		<version>4.3.3.RELEASE</version>
	</dependency>
	<!-- Spring定义Bean的支持 -->
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-beans</artifactId>
		<version>4.3.3.RELEASE</version>
	</dependency>
	<!-- 使用表达式语言在运行时查询和操作对象 -->
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-expression</artifactId>
		<version>4.3.3.RELEASE</version>
	</dependency>
	<!-- End Core Container 核心容器 -->

	<!-- AOP -->
	<!-- 基于代理的AOP支持 -->
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-aop</artifactId>
		<version>4.3.3.RELEASE</version>
	</dependency>
	<!-- 基于AspectJ的AOP支持 -->
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-aspects</artifactId>
		<version>4.3.3.RELEASE</version>
	</dependency>

	<!-- 处理事务和AOP所需的包 -->
	<dependency>
		<groupId>org.aspectj</groupId>
		<artifactId>aspectjrt</artifactId>
	</dependency>
	<dependency>
		<groupId>org.aspectj</groupId>
		<artifactId>aspectjweaver</artifactId>
	</dependency>
	<dependency>
		<groupId>aopalliance</groupId>
		<artifactId>aopalliance</artifactId>
		<version>${aopalliance.version}</version>
	</dependency>

	<!-- web -->
	<!-- 提供基础的web集成的功能,在web项目中提供Spring容器 -->
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-web</artifactId>
		<version>4.3.3.RELEASE</version>
	</dependency>
	<!-- 提供基于Servlet的SpringMVC -->
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-webmvc</artifactId>
		<version>4.3.3.RELEASE</version>
	</dependency>
	<!-- 提供WebSocket功能 -->
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-websocket</artifactId>
		<version>4.3.3.RELEASE</version>
	</dependency>
	<!-- 提供Portlet环境支持 -->
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-webmvc-portlet</artifactId>
		<version>4.3.3.RELEASE</version>
	</dependency>
	<!-- End web -->

	<!-- DataAccess/Integration 数据访问/集成 -->
	<!-- 提供以JDBC访问数据库的支持 -->
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-jdbc</artifactId>
		<version>4.3.3.RELEASE</version>
	</dependency>
	<!-- 提供编程式和声明式的事务支持 -->
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-tx</artifactId>
		<version>4.3.3.RELEASE</version>
	</dependency>
	<!-- 提供对 对象/关系映射技术的支持 -->
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-orm</artifactId>
		<version>4.3.3.RELEASE</version>
	</dependency>
	<!-- 提供对JMS的支持 -->
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-jms</artifactId>
		<version>4.3.3.RELEASE</version>
	</dependency>
	<!-- End DataAccess/Integration 数据访问/集成 -->

	<!-- 将JSON格式的数据转化为类对象 -->
	<dependency>
		<groupId>com.fasterxml.jackson.core</groupId>
		<artifactId>jackson-core</artifactId>
	</dependency>
	<dependency>
		<groupId>com.fasterxml.jackson.core</groupId>
		<artifactId>jackson-databind</artifactId>
	</dependency>
	<dependency>
		<groupId>com.fasterxml.jackson.core</groupId>
		<artifactId>jackson-annotations</artifactId>
	</dependency>

	<!-- 文件上传管理 -->
	<dependency>
		<groupId>commons-io</groupId>
		<artifactId>commons-io</artifactId>
		<version>${commons-io.version}</version>
	</dependency>
	<dependency>
		<groupId>commons-fileupload</groupId>
		<artifactId>commons-fileupload</artifactId>
		<version>${commons-fileupload.version}</version>
		<!-- <exclusions> -->
		<!-- <exclusion> -->
		<!-- <groupId>commons-io</groupId> -->
		<!-- <artifactId>commons-io</artifactId> -->
		<!-- </exclusion> -->
		<!-- </exclusions> -->
	</dependency>
	<!-- 引入poi,解析workbook视图 -->
	<dependency>
		<groupId>org.apache.poi</groupId>
		<artifactId>poi-examples</artifactId>
		<version>${org.apache.poi.version}</version>
	</dependency>
	<dependency>
		<groupId>org.apache.poi</groupId>
		<artifactId>poi-scratchpad</artifactId>
		<version>${org.apache.poi.version}</version>
	</dependency>
	<dependency>
		<groupId>org.apache.poi</groupId>
		<artifactId>poi-excelant</artifactId>
		<version>${org.apache.poi.version}</version>
	</dependency>
	<dependency>
		<groupId>org.apache.poi</groupId>
		<artifactId>poi-ooxml-schemas</artifactId>
		<version>${org.apache.poi.version}</version>
	</dependency>
	<dependency>
		<groupId>org.apache.poi</groupId>
		<artifactId>poi-ooxml</artifactId>
		<version>${org.apache.poi.version}</version>
	</dependency>
	<dependency>
		<groupId>org.apache.poi</groupId>
		<artifactId>poi</artifactId>
		<version>${org.apache.poi.version}</version>
	</dependency>
	<!-- 处理excel和上面功能是一样的 -->
	<dependency>
		<groupId>net.sourceforge.jexcelapi</groupId>
		<artifactId>jxl</artifactId>
		<version>${jxl.version}</version>
	</dependency>
	<!-- Mybatis代码生成工具 -->
	<dependency>
		<groupId>org.mybatis.generator</groupId>
		<artifactId>mybatis-generator-core</artifactId>
		<version>${mybatis-generator.version}</version>
	</dependency>

	<!-- Oracle连接 -->
	<dependency>
		<groupId>com.github.noraui</groupId>
		<artifactId>ojdbc8</artifactId>
		<version>${oracle.version}</version>
	</dependency>
	<!-- MySQL连接 -->
	<dependency>
		<groupId>mysql</groupId>
		<artifactId>mysql-connector-java</artifactId>
	</dependency>
	<!-- 获取本地计算机信息 -->
	<dependency>
		<groupId>com.github.votoanthuan</groupId>
		<artifactId>sigar</artifactId>
		<version>${sigar.version}</version>
	</dependency>
	<!-- JSON字符串和java对象的互转 -->
	<dependency>
		<groupId>net.sf.json-lib</groupId>
		<artifactId>json-lib</artifactId>
		<version>${json-lib.version}</version>
		<classifier>jdk15</classifier>
	</dependency>
	<!-- XML工具包 -->
	<dependency>
		<groupId>xom</groupId>
		<artifactId>xom</artifactId>
		<version>${xom.version}</version>
	</dependency>
	<dependency>
		<groupId>apache-httpclient</groupId>
		<artifactId>commons-httpclient</artifactId>
		<version>${apache-httpclient.version}</version>
	</dependency>
	<!-- 将httpcore4.2.1、httpclient4.2.1版本号改成api接口可用的版本 -->
	<dependency>
		<groupId>org.apache.httpcomponents</groupId>
		<artifactId>httpcore-nio</artifactId>
	</dependency>
	<!-- http请求工具 -->
	<dependency>
		<groupId>org.apache.httpcomponents</groupId>
		<artifactId>httpclient</artifactId>
	</dependency>

	<!-- java控制远程ssh,JAVA使用JSCH实现SFTP文件管理(上传、下载等) -->
	<dependency>
		<groupId>com.jcraft</groupId>
		<artifactId>jsch</artifactId>
		<version>${jsch.version}</version>
	</dependency>
	<dependency>
		<groupId>org.apache.httpcomponents</groupId>
		<artifactId>httpcore</artifactId>
	</dependency>
</dependencies>

<build>
	<finalName>${project.artifactId}</finalName>
	<pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.mybatis.generator</groupId>
				<artifactId>mybatis-generator-maven-plugin</artifactId>
				<version>${mybatis-generator.version}</version>
				<!-- 数据库驱动 -->
				<dependencies>
					<dependency>
						<groupId>mysql</groupId>
						<artifactId>mysql-connector-java</artifactId>
						<version>${mysql.version}</version>
					</dependency>
					<dependency>
						<groupId>com.github.noraui</groupId>
						<artifactId>ojdbc8</artifactId>
						<version>${oracle.version}</version>
					</dependency>
				</dependencies>
				<!-- 自动生成 -->
				<executions>
					<execution>
						<id>Generate MyBatis Artifacts</id>
						<goals>
							<goal>generate</goal>
						</goals>
						<configuration>
							<!-- 指定文件位置好像不起作用,始终默认读取src/main/resources/generatorConfig.xml文件 -->
							<configurationFile>src/main/resources/generatorConfig.xml</configurationFile>
							<!--允许移动生成的文件 -->
							<verbose>true</verbose>
							<!--允许覆盖生成的文件 -->
							<overwrite>true</overwrite>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
		</plugins>
	</pluginManagement>
</build>
 类似资料: