11.12. Maven project documentation

发布时间 : 2025-10-25 13:35:08 UTC      

Page Views: 9 views

In this section, we focus on how to create Maven project documents.

For example, we create a consumerBanking project under the C:/MVN directory, and Maven uses the following command to quickly create a java project:

mvn archetype:generate -DgroupId=com.companyname.bank -DartifactId=consumerBanking -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false 

Modify the pom.xml to add the following configuration (if not available):

<project>...<build><pluginManagement><plugins><plugin><groupId>org.apache.maven.pluginsgroupId><artifactId>maven-site-pluginartifactId><version>3.3version>plugin><plugin><groupId>org.apache.maven.pluginsgroupId><artifactId>maven-project-info-reports-pluginartifactId><version>2.7version>plugin>plugins>pluginManagement>build>...project>    
不然运行mvn site 命令时出现 **java.lang.NoClassDefFoundError: org/apache/maven/doxia/siterenderer/DocumentContent** 的问题, 这是由于 maven-site-plugin 版本过低,升级到 3.3+ 即可。 

Open the consumerBanking folder and execute the following mvn command.

C:\MVN\consumerBanking> mvn site 

Maven begins to generate documentation:

[INFO] Scanning for projects... [INFO] ------------------------------------------------------------------- [INFO] Building consumerBanking [INFO]task-segment: [site] [INFO] ------------------------------------------------------------------- [INFO] [site:site {execution: default-site}] [INFO] artifact org.apache.maven.skins:maven-default-skin: checking for updates from central [INFO] Generating "About" report. [INFO] Generating "Issue Tracking" report. [INFO] Generating "Project Team" report. [INFO] Generating "Dependencies" report. [INFO] Generating "Continuous Integration" report. [INFO] Generating "Source Repository" report. [INFO] Generating "Project License" report. [INFO] Generating "Mailing Lists" report. [INFO] Generating "Plugin Management" report. [INFO] Generating "Project Summary" report. [INFO] ------------------------------------------------------------------- [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------- [INFO] Total time: 16 seconds [INFO] Finished at: Wed Jul 11 18:11:18 IST 2012 [INFO] Final Memory: 23M/148M [INFO] ------------------------------------------------------------------- 

image0

打开 C:MVNconsumerBankingtargetsite 文件夹。点击 index.html 就可以看到文档了。

image1

Maven uses a file named Doxia Document processing engine to create documents, which can read various formats of source code into a common document model. To document your project, you can write the content in the following common formats that can be converted by Doxia.

Format name

Description

Referenc

Apt

Plain text document format

http://maven.apache.o rg/doxia/references/a pt-format.html

Xdoc

A document format for Maven 1.x

http://jakarta.apache .org/site/jakarta-sit e2.html

FML

FAQ documentation is applicable

http://maven.apache.o rg/doxia/references/f ml-format.html

XHTML

Extensible HTML documents

http://en.wikipedia.o rg/wiki/XHTML

《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。