基于Maven site的穷人的本地知识管理系统

时间:2022-05-20 17:30:37

1 Motivation

On daily study or development, a simple knowledge management system is required.

In the system, you can record long-lived domain concepts, one-short framework configuration information, and other resources you need to touch in hand.

2 Maven site

2.1 Introduction

The original purpose of Maven Site Plugin is to build a site for a project, in which project summary information, manual, and other resources can be included.

2.2 Resources

Creating a site

Apache Maven Site Plugin: goals and usage

2.3 Advance features

custom documentation format

Complete supported formats can be seen in Doxia Markup Languages References.

custom template and page style

Since Maven site uses Velocity template to render html page, so it can be customized naturally, see Changing the Template File for more information.

Also, the look-and-feel of the generated project site can be changed, see Creating Skins for more information.

3 An example

I choose Markdown as the documentation format for its simplicity.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-site-plugin</artifactId>
    <!-- <version>3.2</version> -->
    <dependencies>
        <dependency>
            <groupId>org.apache.maven.doxia</groupId>
            <artifactId>doxia-module-markdown</artifactId>
            <version>1.3</version>
        </dependency>
    </dependencies>
    <configuration>
        <!-- 定义模板 -->
        <templateDirectory>${basedir}/template</templateDirectory>
        <template>my-site.html</template>
    </configuration>
</plugin>

A screenshot of generated site after running mvn clean site site:run:

基于Maven site的穷人的本地知识管理系统