2 Star 3 Fork 3

千寻啊千寻 / qianxunclub-maven-plugin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

插件是用apidoc插件生成文档的,具体使用方式可查看官网:http://apidocjs.com/

该插件不会直接生成APIDOC文档,只会自动生成apidoc.json文件,需要执行apidoc命令才可以生成
apidoc.json文件会生成在项目根目录apidoc文件夹下

编辑pom.xml,引入maven plugin

在项目的pom文件中引入以下:

<plugin>
	<groupId>com.qianxunclub</groupId>
	<artifactId>qianxunclub-plugin-apidoc</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<executions>
		<execution>
			<goals>
				<goal>apidoc</goal>
			</goals>
		</execution>
	</executions>
</plugin>

properties定义API的生成规范:

<properties>
	<apidoc.skip>false/</apidoc.skip>
	<apidoc.gen>false</apidoc.gen>
	<apidoc.url>http://ip:port/</apidoc.url>
	<apidoc.sampleUrl>http://ip:port/</apidoc.sampleUrl>
</properties>

apidoc.skip:编译代码是否跳过生成apidoc.json
apidoc.gen:是否覆盖更新apidoc.json
apidoc.url:实例接口前缀
apidoc.sampleUrl:生成测试方法的请求地址

开始生成

执行命令:

mvn clean package

可以添加以下参数:

mvn clean package -Dapidoc.skip=true

-Dapidoc.skip=true:编译代码是否跳过生成apidoc.json
-Dapidoc.gen=true:是否覆盖更新apidoc.json
-Dapidoc.url=xxx:实例接口前缀
-Dapidoc.sampleUrl=xxx:生成测试方法的请求地址

如果出现以下字样,说明生成完成:

apidoc.json完成

生成api文档

在项目跟目录执行:

apidoc -i apidoc/ -o API文档存放目录/

打开API文档存放目录中的index.html即可查看文档。

空文件

简介

apidoc插件生成文档 展开 收起
Java
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/qianxunclub/qianxunclub-maven-plugin.git
git@gitee.com:qianxunclub/qianxunclub-maven-plugin.git
qianxunclub
qianxunclub-maven-plugin
qianxunclub-maven-plugin
master

搜索帮助