實際項目中我們可能需要進行maven 項目的site 文檔發布,一般的處理是生成之后,然后在進行發布到一個靜態
服務器進行頁面訪問,nexus3 提供了一個Raw Repositories 很方便可以直接幫我們搞定問題
創建Raw Repositories
我選擇了s3 minio 做為存儲,實際上直接使用minio 進行存儲也是不錯的
項目使用(pom.xml)
注意使用的協議是 dav
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>nexus-proxy</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>25.1-jre</version>
</dependency>
</dependencies>
<distributionManagement>
<site>
<id>nexus-app</id>
<url>dav:http://nexushost:8081/repository/myinfo/</url>
</site>
</distributionManagement>
<build>
<plugins>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.4</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-webdav-jackrabbit</artifactId>
<version>2.8</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
構建發布
mvn site-deploy
效果
參考資料
https://help.sonatype.com/repomanager3/raw-repositories-and-maven-sites
https://github.com/rongfengliang/mino-thumbor-openresty