<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.wanmei.demoForYuzhi</groupId> <artifactId>demo</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <name>demoForYuzhi</name> <description>给于智做的测试样例</description> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <spring.version>4.0.0.RELEASE</spring.version> <org.slf4j.version>1.6.6</org.slf4j.version> <commons-logging.version>1.1.1</commons-logging.version> <log4j.version>1.2.14</log4j.version> <guava.version>16.0</guava.version> <junit.version>4.11</junit.version> <fastjson.version>1.1.22</fastjson.version> <h2.version>1.3.175</h2.version> <netty.version>3.8.0.Final</netty.version> <quartz.version>2.2.1</quartz.version> <jetty.version>9.1.4.v20140401</jetty.version> </properties> <dependencies> <dependency> <groupId>org.eclipse.jetty.aggregate</groupId> <artifactId>jetty-all</artifactId> <version>${jetty.version}</version> </dependency> <!-- database h2 start --> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <version>${h2.version}</version> </dependency> <!-- database h2 end --> <dependency> <groupId>org.apache.tomcat</groupId> <artifactId>servlet-api</artifactId> <version>6.0.39</version> </dependency> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>${guava.version}</version> </dependency> <!-- test start --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${junit.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.easymock</groupId> <artifactId>easymock</artifactId> <version>3.0</version> </dependency> <!-- test end --> <!-- jdbc start --> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>11.0</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.27</version> </dependency> <!-- jdbc end --> <!-- commons start --> <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> <version>1.8.3</version> </dependency> <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> <version>1.8</version> </dependency> <dependency> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> <version>3.2.1</version> </dependency> <dependency> <groupId>commons-dbcp</groupId> <artifactId>commons-dbcp</artifactId> <version>1.4</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.2</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.1</version> </dependency> <!-- commons end --> <!-- json start --> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>${fastjson.version}</version> </dependency> <!-- json end --> <dependency> <groupId>javax.transaction</groupId> <artifactId>jta</artifactId> <version>1.1</version> </dependency> <dependency> <groupId>aopalliance</groupId> <artifactId>aopalliance</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>javax.mail</groupId> <artifactId>mail</artifactId> <version>1.4.3</version> </dependency> <dependency> <groupId>javax.activation</groupId> <artifactId>activation</artifactId> <version>1.1</version> </dependency> <!-- spring dependences start --> <dependency> <groupId>org.quartz-scheduler</groupId> <artifactId>quartz</artifactId> <version>${quartz.version}</version> </dependency> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.3</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.7.4</version> </dependency> <!-- spring dependences end --> <!-- jms start --> <dependency> <groupId>javax.jms</groupId> <artifactId>javax.jms-api</artifactId> <version>2.0</version> </dependency> <!-- jms end --> <!-- netty start --> <dependency> <groupId>io.netty</groupId> <artifactId>netty</artifactId> <version>${netty.version}</version> </dependency> <!-- netty end --> <!-- spring start --> <!-- spring log dependency start --> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> <version>${org.slf4j.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>${org.slf4j.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>${org.slf4j.version}</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>${log4j.version}</version> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>${commons-logging.version}</version> </dependency> <!-- spring log dependency end --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-instrument</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jms</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-oxm</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.3.0</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.3.0</version> </dependency> <!-- spring end --> <dependency> <groupId>org.glassfish</groupId> <artifactId>bean-validator</artifactId> <version>3.0-JBoss-4.0.2</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.enterprise.deploy</artifactId> <version>3.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.jms</artifactId> <version>3.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.management.j2ee</artifactId> <version>3.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.eclipse.persistence</groupId> <artifactId>javax.persistence</artifactId> <version>2.0.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.resource</artifactId> <version>3.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.security.auth.message</artifactId> <version>3.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.security.jacc</artifactId> <version>3.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.servlet</artifactId> <version>3.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.servlet.jsp</artifactId> <version>3.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.glassfish</groupId> <artifactId>javax.servlet.jsp.jstl</artifactId> <version>3.0.1</version> <!-- <scope>provided</scope> --> </dependency> <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api-osgi</artifactId> <version>2.2.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.ws.rs</groupId> <artifactId>jsr311-api</artifactId> <version>1.1.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.glassfish.web</groupId> <artifactId>jstl-impl</artifactId> <version>1.2</version> <!-- scope>provided</scope> --> </dependency> <dependency> <groupId>javax.xml</groupId> <artifactId>webservices-api-osgi</artifactId> <version>2.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.jboss.weld</groupId> <artifactId>weld-osgi-bundle</artifactId> <version>1.0.1-SP3</version> <scope>provided</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <version>2.2.1</version> <executions> <execution> <id>attach-sources</id> <phase>verify</phase> <goals> <goal>jar-no-fork</goal> </goals> </execution> </executions> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>2.2</version> <configuration> <version>3.0</version> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <version>2.2.1</version> <!-- <configuration> <outputDirectory>/absolute/path/to/the/output/directory</outputDirectory> <finalName>filename-of-generated-jar-file</finalName> <attach>false</attach> </configuration> --> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <reporting> <plugins> <!-- 测试报告 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-report-plugin</artifactId> <version>2.16</version> <configuration> <showSuccess>false</showSuccess> </configuration> </plugin> <!-- 项目源码 plugin --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jxr-plugin</artifactId> <version>2.2</version> <configuration> <!-- 只有聚合项目需要使用该配置 --> <aggregate>false</aggregate> </configuration> </plugin> <!-- PMD 代码分析工具 --> <plugin> <artifactId>maven-pmd-plugin</artifactId> <version>3.0.1</version> <reportSets> <reportSet> <reports> <report>pmd</report> <report>cpd</report> </reports> </reportSet> </reportSets> </plugin> <plugin> <artifactId>maven-javadoc-plugin</artifactId> <version>2.9.1</version> </plugin> </plugins> </reporting> </project>
maven 命令:
mvn help:system --> 所有的Java系统属性和环境变量
mvn archetype:generate --> 生产项目的骨架
<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> <!-- Inherit defaults from Spring Boot --> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.0.5.RELEASE</version> </parent> <groupId>org.kanpiaoxue</groupId> <artifactId>hello</artifactId> <version>0.0.1</version> <packaging>pom</packaging> <name>hello</name> <url>http://maven.apache.org</url> <modules> <module>hello-commons</module> <module>hello-cleanlog</module> </modules> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <guava.version>26.0-jre</guava.version> <gson.version>2.8.5</gson.version> <springboot-admin-client>2.0.3</springboot-admin-client> <!-- test --> <junit.version>4.11</junit.version> <powermock.version>1.6.2</powermock.version> <mockito.version>1.10.19</mockito.version> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-starter-client</artifactId> <version>${springboot-admin-client}</version> </dependency> <!-- https://mvnrepository.com/artifact/com.google.guava/guava --> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>${guava.version}</version> </dependency> <dependency> <groupId>joda-time</groupId> <artifactId>joda-time</artifactId> <version>2.10</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.8</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-collections4</artifactId> <version>4.2</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.6</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-configuration2</artifactId> <version>2.3</version> </dependency> <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>${gson.version}</version> </dependency> <!-- test start --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${junit.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-module-junit4-rule-agent</artifactId> <version>${powermock.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.powermock.tests</groupId> <artifactId>powermock-tests-utils</artifactId> <version>${powermock.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-core</artifactId> <version>${powermock.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-module-junit4</artifactId> <version>${powermock.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-all</artifactId> <version>${mockito.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-api-mockito</artifactId> <version>${powermock.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-classloading-xstream</artifactId> <version>${powermock.version}</version> <scope>test</scope> </dependency> <!-- test end --> </dependencies> </dependencyManagement> </project>
相关推荐
3. **pom.xml**: Maven 的配置文件,定义了项目的基本信息、依赖关系、构建过程等。 **Spring Boot 主要特性** 1. **自动配置**: Spring Boot 根据 classpath 中的 jar 包和配置文件自动进行配置,大大减少了手动...
Maven的POM文件将定义所有相关的依赖,包括Spring、SpringMVC、MyBatis、企业微信SDK等,以及构建和打包的规则。在实际开发中,开发者还需要配置Spring的bean定义文件(如applicationContext.xml),SpringMVC的配置...
在Maven项目中,配置文件主要体现在`pom.xml`,这是Maven的核心文件,包含了项目信息、构建设置、依赖关系和插件配置等。通过`pom.xml`,我们可以指定项目的依赖库,构建目标,以及执行的构建过程。 2. Spring配置...
【标题】"mavenWeb空项目"所涉及的知识点主要集中在Java编程语言和Maven构建工具上,这是一个基于Maven的、已经过单元测试的Web应用程序的基础框架。下面将详细介绍这两个核心领域的相关知识。 **一、Java编程语言*...
SSM框架,即Spring、SpringMVC和MyBatis的集成,是Java Web开发中常用的一种框架组合。这种整合能够帮助开发者有效地管理依赖、处理业务逻辑以及实现数据持久化。在进行SSM框架的整合时,我们需要关注的核心知识点...
Spring MVC的配置文件(如`servlet-context.xml`)则用于设置Web应用的路由规则和视图解析器;MyBatis的配置文件(`mybatis-config.xml`)包含数据库连接信息和Mapper配置。这3个配置文件的正确设置是SSM框架成功...
在这个空的 Spring Web Maven 项目中,你需要根据自己的需求修改 `pom.xml` 文件,比如添加或更新依赖项,以及设置私服(Nexus 或 Artifactory)的仓库地址,以便从那里下载所需的库文件。 **四、快速搭建 Spring ...
POM(Project Object Model)是Maven的核心概念,`pom.xml`文件包含了项目的基本信息、依赖、构建配置等。主要元素有: - `<modelVersion>`:声明POM模型的版本。 - `<groupId>`:标识项目的组织或公司。 - `...
2. **POM.xml**:编辑POM文件,添加项目依赖(如Spring、Hibernate等框架),指定项目属性如版本、打包类型等。 3. **Maven构建生命周期**:理解clean、compile、test、package、install和deploy等阶段,了解如何...
【MavenWeb项目创建】 Maven是一个强大的Java项目管理和构建工具,它可以帮助开发者管理项目的依赖关系,自动化构建过程,使得项目构建标准化。在MavenWeb项目创建中,我们需要理解以下几个核心知识点: 1. **...
通过配置`<packaging>war</packaging>`,Maven会将项目打包成WAR,并可设置war包中的Web-INF目录结构。 4. **打包**:Maven提供了多种打包类型,如jar、war、ear等。通过`<build><plugins>`部分的配置,可以调用...
在Java EE开发中,Eclipse是一个常用的集成开发环境,而Maven则是一个强大的构建工具,用于管理项目的依赖和构建流程。Tomcat是一个流行的轻量级应用服务器,常用于部署Java Web应用程序。本篇文章将详细解释如何在...
- 在Maven的`pom.xml`文件中,添加Spring、SpringMVC、MyBatis以及它们依赖的库。 - 最后,编写业务逻辑层(Service)和控制层(Controller)的代码,实现业务需求。 6. **IDEAproject**:这可能是指在IntelliJ ...
Maven 的 pom 文件是 Maven 工作的基本组件,是一个 XML 文件。pom 文件包含依赖、插件、属性等配置。pom 文件的根元素是 project,它有三个主要的子节点:groupId、artifactId 和 version。groupId 是工程组的标识...
Java Maven 项目中,CKFinder 2.3 是一个常用的内容管理和文件上传工具,它能够与后端应用程序集成,提供用户友好的界面来管理和上传文件。CKFinder 的 Maven 依赖是开发人员在 Java 应用中整合这个功能的关键。下面...
下面将介绍在Eclipse上Maven结构Web项目如何部署到Tomcat的几种常用的方法。 以.war包的形式部署到Tomcat 要将Maven项目部署到Tomcat服务器,我们可以将项目打包成.war文件,然后将其拷贝到Tomcat的webapps文件夹...
1. **POM(Project Object Model)**: Maven的核心是POM,它是Maven项目的基础配置文件,包含了项目的信息、依赖管理、构建指令等。POM.xml文件位于项目根目录下。 2. **仓库**: Maven使用仓库来存储和检索依赖项,...
在项目中,你可以看到pom.xml文件,这是Maven的项目对象模型,它定义了项目依赖、构建配置等信息。 **5. 项目结构** 一个典型的SSM项目结构通常包含以下部分: - src/main/java:存放Java源代码,包括Spring的配置...