--- tags: maven --- # Maven How-To ## 如何安裝 jar 到 Local repository 1. 使用 command ``` mvn install:install-file -Dfile=<path-to-file> -DpomFile=<path-to-pomfile> ``` Ref: https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html 2. Install Local Jar With the maven-install-plugin Ref: https://www.baeldung.com/install-local-jar-with-maven/#install ## 使用 Maven 建立 Project Site ### Plugins ```xml= <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> <version>3.7.1</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-project-info-reports-plugin</artifactId> <version>3.0.0</version> </plugin> </plugins> </build> ``` Ref: https://mkyong.com/maven/mvn-site-java-lang-classnotfoundexception-org-apache-maven-doxia-siterenderer-documentcontent/ ### 目錄結構 ``` +- src/ +- site/ +- apt/ | +- index.apt ! +- markdown/ | +- index.md | +- xdoc/ | +- other.xml | +- fml/ | +- general.fml | +- faq.fml | +- resources/ | +- img/ | +- site.xml ``` 在 `site.xml` 中可以設定 side menu 的內容 在 `src/site/resources/` 中放圖片等資源 Ref: https://maven.apache.org/guides/mini/guide-site.html ### 指令 `mvn site` Ref: https://maven.apache.org/guides/mini/guide-site.html