|
| 1 | +<project xmlns="http://maven.apache.org/POM/4.0.0" |
| 2 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 3 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| 4 | + <modelVersion>4.0.0</modelVersion> |
| 5 | + |
| 6 | + <groupId>com.api</groupId> |
| 7 | + <artifactId>tests</artifactId> |
| 8 | + <version>1.0-SNAPSHOT</version> |
| 9 | + <packaging>jar</packaging> |
| 10 | + |
| 11 | + <name>api-tests: API test plots for Java</name> |
| 12 | + <description> |
| 13 | + Java API 试验田,API test plots for Java。 |
| 14 | + API 不知道如何使用以及有哪些坑,就在这里通过单元测试(Unit Test,UT)试验。 |
| 15 | + </description> |
| 16 | + <url>https://github.com/EdwardLee03/api-tests</url> |
| 17 | + |
| 18 | + <properties> |
| 19 | + <jdk.version>1.7</jdk.version> |
| 20 | + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| 21 | + </properties> |
| 22 | + |
| 23 | + <dependencies> |
| 24 | + </dependencies> |
| 25 | + |
| 26 | + <issueManagement> |
| 27 | + <system>GitHub Issues</system> |
| 28 | + <url>https://github.com/EdwardLee03/api-tests/issues</url> |
| 29 | + </issueManagement> |
| 30 | + |
| 31 | + <inceptionYear>2016</inceptionYear> |
| 32 | + <licenses> |
| 33 | + <license> |
| 34 | + <name>The Apache Software License, Version 2.0</name> |
| 35 | + <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> |
| 36 | + <distribution>repo</distribution> |
| 37 | + </license> |
| 38 | + </licenses> |
| 39 | + |
| 40 | + <scm> |
| 41 | + <connection>scm:git:https://github.com/EdwardLee03/api-tests.git</connection> |
| 42 | + < developerConnection>scm:git: [email protected]:EdwardLee03/api-tests.git</ developerConnection> |
| 43 | + <url>https://github.com/EdwardLee03/api-tests</url> |
| 44 | + </scm> |
| 45 | + |
| 46 | + <developers> |
| 47 | + <developer> |
| 48 | + <id>EdwardLee03</id> |
| 49 | + <name>Edward Lee</name> |
| 50 | + |
| 51 | + <organization>non</organization> |
| 52 | + <organizationUrl>https://github.com/EdwardLee03</organizationUrl> |
| 53 | + <roles> |
| 54 | + <role>owner</role> |
| 55 | + <role>developer</role> |
| 56 | + </roles> |
| 57 | + <timezone>+8</timezone> |
| 58 | + </developer> |
| 59 | + </developers> |
| 60 | + |
| 61 | + <build> |
| 62 | + <!-- InfoQ Maven专栏(三)——多模块项目的POM重构 --> |
| 63 | + <!-- 消除多模块插件配置重复 --> |
| 64 | + <plugins> |
| 65 | + <!-- FAQ - How do I set up Maven so it will compile with a target and source JVM of my choice? --> |
| 66 | + <!-- 配置JDK编译版本 --> |
| 67 | + <plugin> |
| 68 | + <groupId>org.apache.maven.plugins</groupId> |
| 69 | + <artifactId>maven-compiler-plugin</artifactId> |
| 70 | + <version>3.3</version> |
| 71 | + <configuration> |
| 72 | + <source>${jdk.version}</source> |
| 73 | + <target>${jdk.version}</target> |
| 74 | + <encoding>${project.build.sourceEncoding}</encoding> |
| 75 | + </configuration> |
| 76 | + </plugin> |
| 77 | + <!-- XML、properties文件都是资源文件,编码的时候遇到中文总要进行转码!用什么编码?UTF-8 --> |
| 78 | + <plugin> |
| 79 | + <groupId>org.apache.maven.plugins</groupId> |
| 80 | + <artifactId>maven-resources-plugin</artifactId> |
| 81 | + <version>2.7</version> |
| 82 | + <configuration> |
| 83 | + <encoding>${project.build.sourceEncoding}</encoding> |
| 84 | + </configuration> |
| 85 | + </plugin> |
| 86 | + <!-- [单元、集成]测试 --> |
| 87 | + <plugin> |
| 88 | + <groupId>org.apache.maven.plugins</groupId> |
| 89 | + <artifactId>maven-surefire-plugin</artifactId> |
| 90 | + <version>2.18.1</version> |
| 91 | + <configuration> |
| 92 | + <!-- Running Tests in Parallel --> |
| 93 | + <parallel>methods</parallel> |
| 94 | + <threadCount>8</threadCount> |
| 95 | + <!-- Examples - Using TestNG --> |
| 96 | + <suiteXmlFiles> |
| 97 | + <suiteXmlFile>testng.xml</suiteXmlFile> |
| 98 | + </suiteXmlFiles> |
| 99 | + </configuration> |
| 100 | + </plugin> |
| 101 | + <!-- Cookbook: How to attach source and javadoc artifacts? - https://maven.apache.org/plugin-developers/cookbook/attach-source-javadoc-artifacts.html --> |
| 102 | + <!-- 生成源码包和API文档包的命令:mvn clean package source:jar javadoc:jar -Dmaven.test.skip=true --> |
| 103 | + <!-- 生成源码包 --> |
| 104 | + <plugin> |
| 105 | + <groupId>org.apache.maven.plugins</groupId> |
| 106 | + <artifactId>maven-source-plugin</artifactId> |
| 107 | + <version>2.4</version> |
| 108 | + <executions> |
| 109 | + <!-- Usage - Installing the sources using a phase binding --> |
| 110 | + <execution> |
| 111 | + <id>attach-sources</id> |
| 112 | + <phase>verify</phase> |
| 113 | + <goals> |
| 114 | + <goal>jar</goal> |
| 115 | + </goals> |
| 116 | + </execution> |
| 117 | + </executions> |
| 118 | + </plugin> |
| 119 | + <!-- 生成API文档包 --> |
| 120 | + <plugin> |
| 121 | + <groupId>org.apache.maven.plugins</groupId> |
| 122 | + <artifactId>maven-javadoc-plugin</artifactId> |
| 123 | + <version>2.10.3</version> |
| 124 | + <configuration> |
| 125 | + <show>private</show> |
| 126 | + <nohelp>true</nohelp> |
| 127 | + </configuration> |
| 128 | + <executions> |
| 129 | + <execution> |
| 130 | + <id>aggregate</id> |
| 131 | + <phase>site</phase> |
| 132 | + <goals> |
| 133 | + <goal>aggregate</goal> |
| 134 | + </goals> |
| 135 | + </execution> |
| 136 | + </executions> |
| 137 | + </plugin> |
| 138 | + <!-- 生成项目站点 --> |
| 139 | + <!-- FAQ - Handle special characters in site --> |
| 140 | + <plugin> |
| 141 | + <groupId>org.apache.maven.plugins</groupId> |
| 142 | + <artifactId>maven-site-plugin</artifactId> |
| 143 | + <version>3.4</version> |
| 144 | + <configuration> |
| 145 | + <outputEncoding>${project.build.sourceEncoding}</outputEncoding> |
| 146 | + <locales>cn,en</locales> |
| 147 | + </configuration> |
| 148 | + </plugin> |
| 149 | + <!-- 部署项目jar包到远程中央仓库 --> |
| 150 | + <!-- Deploy sources and javadoc jars - https://maven.apache.org/plugins/maven-deploy-plugin/examples/deploying-sources-javadoc.html --> |
| 151 | + <!-- Maven Deploy Plugin > Usage - https://maven.apache.org/plugins/maven-deploy-plugin/usage.html --> |
| 152 | + <!-- deploy:deploy-file - https://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html --> |
| 153 | + <!-- 部署源码包和API文档包到远程中央仓库的命令: |
| 154 | + mvn deploy:deploy-file -Durl=http://maven.mogujie.org/nexus/content/repositories/snapshots \ |
| 155 | + -DrepositoryId=snapshots \ |
| 156 | + -DpomFile=pom.xml \ |
| 157 | + -Dfile=target/ferrari-api-1.0-SNAPSHOT.jar \ |
| 158 | + -Dsources=target/ferrari-api-1.0-SNAPSHOT-sources.jar \ |
| 159 | + -Djavadoc=target/ferrari-api-1.0-SNAPSHOT-javadoc.jar |
| 160 | + --> |
| 161 | + <plugin> |
| 162 | + <groupId>org.apache.maven.plugins</groupId> |
| 163 | + <artifactId>maven-deploy-plugin</artifactId> |
| 164 | + <version>2.8.2</version> |
| 165 | + </plugin> |
| 166 | + </plugins> |
| 167 | + |
| 168 | + <!-- Maven Resources Plugin - Filtering - http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html --> |
| 169 | + <resources> |
| 170 | + <resource> |
| 171 | + <directory>src/main/resources</directory> |
| 172 | + <filtering>true</filtering><!-- 启用过滤功能 --> |
| 173 | + </resource> |
| 174 | + </resources> |
| 175 | + </build> |
| 176 | +</project> |
0 commit comments