-
Notifications
You must be signed in to change notification settings - Fork 295
How to make smart doc load source code
shalousun edited this page Nov 3, 2019
·
11 revisions
Smart-doc is a tool for analyzing generated documents based entirely on source code annotations. If there is no source code, you will only see information such as field name and field type when generating the document. Here's how to load Smart-doc into project code outside of the running module:
An example is as follows:
ApiConfig config = new ApiConfig();
/ / Use SourceCodePath to set the source code path
config.setSourceCodePaths(
SourceCodePath.path().setDesc("Load external project source").setPath("E:\\Test\\Mybatis-PageHelper-master\\src\\main\\java")
);
With the above configuration, smart-doc can load and analyze external source code.
An example is as follows:
<!--Yīlài de kù-->
<dependency>
<groupId>com.Github.Shalousun</groupId>
<artifactId>common-util</artifactId>
<version>1.8.6</Version>
</dependency>
<!--Yīlài kù yuánmǎ-->
<dependency>
<groupId>com.Github.Shalousun</groupId>
<artifactId>common-util</artifactId>
<version>1.8.6</Version>
<classifier>sources</classifier>
<!--Shèzhì wèi test, xiàngmù fābù shí source bù huì fàng rù zuìzhōng de chǎnpǐn bāo-->
<scope>test</scope>
</dependency>
展开
408/5000
<!--Dependent library -->
<dependency>
<groupId>com.github.shalousun</groupId>
<artifactId>common-util</artifactId>
<version>1.8.6</version>
</dependency>
<!--Dependent library source code-->
<dependency>
<groupId>com.github.shalousun</groupId>
<artifactId>common-util</artifactId>
<version>1.8.6</version>
<classifier>sources</classifier>
<!--Set to test, source will not be placed in the final product package when the project is released -->
<scope>test</scope>
</dependency>
This does not require setting the source code load path as above.