From cb693d49402ebd5b81bc53a4a63a5908d523dd1b Mon Sep 17 00:00:00 2001 From: shalousun <836575280@qq.com> Date: Sat, 11 Jul 2026 13:51:37 +0800 Subject: [PATCH] feat: update faq --- docs/en/guide/faq/faq.md | 29 +++++++++++++++++++++++++++++ docs/zh/guide/faq/faq.md | 29 +++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/docs/en/guide/faq/faq.md b/docs/en/guide/faq/faq.md index 316fe11..4779d62 100644 --- a/docs/en/guide/faq/faq.md +++ b/docs/en/guide/faq/faq.md @@ -224,6 +224,35 @@ This problem actually has nothing to do with `smart-doc`, but some students who In fact, this is because after adding the `maven` plug-in of `smart-doc` to the project, there were some problems with my own network, which resulted in the official plug-in not being downloaded from the `maven` repository. +### How to use SNAPSHOT version dependency source code? + +`smart-doc-maven-plugin` automatically downloads the `-sources.jar` of dependencies for source code analysis. +However, the plugin does not have built-in SNAPSHOT-specific configuration for source JAR resolution. + +Whether SNAPSHOT dependency source JARs can be downloaded depends on your Maven repository configuration: + +1. Ensure the remote repository has SNAPSHOT support enabled and the corresponding `-sources.jar` is deployed. +2. Configure the repository in your project's `pom.xml` with explicit SNAPSHOT settings: + +```xml + + + snapshots + your-snapshot-repository-url + + true + always + + + +``` + +3. If the SNAPSHOT source JAR still cannot be resolved, verify that: + - The remote repository actually contains the SNAPSHOT version's `-sources.jar`. + - Your local Maven cache is not stale — try deleting the locally cached SNAPSHOT artifacts and rebuild. + +> **Note:** The plugin uses Maven's underlying `RepositorySystem` API for resolution and does not set a custom snapshot update policy. Setting `always` in your repository configuration ensures Maven always checks for the latest SNAPSHOT sources. + ## Other ### How to solve memory overflow? diff --git a/docs/zh/guide/faq/faq.md b/docs/zh/guide/faq/faq.md index a15366a..17b41d0 100644 --- a/docs/zh/guide/faq/faq.md +++ b/docs/zh/guide/faq/faq.md @@ -224,6 +224,35 @@ No plugin found for prefix 'smart-doc' in the current project and in the plugin +### 如何使用快照(SNAPSHOT)版本的依赖源码? + +`smart-doc-maven-plugin`会自动下载依赖的`-sources.jar`来进行源码分析。 +但插件本身没有针对SNAPSHOT版本做专门的源码JAR解析配置。 + +能否下载SNAPSHOT版本的依赖源码,取决于你的Maven仓库配置: + +1. 确保远程仓库开启了SNAPSHOT支持,并且部署了对应版本的`-sources.jar`。 +2. 在项目的`pom.xml`中明确配置仓库的SNAPSHOT策略: + +```xml + + + snapshots + 你的快照仓库地址 + + true + always + + + +``` + +3. 如果SNAPSHOT源码JAR仍然无法解析,请检查: + - 远程仓库是否确实包含了SNAPSHOT版本的`-sources.jar`。 + - 本地Maven缓存是否过期——可以尝试删除本地缓存的SNAPSHOT构件后重新构建。 + +> **注意:** 插件底层使用Maven的`RepositorySystem` API来解析依赖,未设置自定义的快照更新策略。在仓库配置中将``设置为`always`可以确保Maven每次都检查最新的SNAPSHOT源码。 + ## 其他 ### 内存溢出了怎么解决?