本文提供了使用GitHub发布Maven项目的分步指南网站Maven插件。
Prerequisites
- Github上的项目存储库Java和Maven熟悉Maven配置
Create a repository for your maven project on Github if you don't have one already and push your maven project. This method will use the site-maven-plugin to push the artifacts to Github.
当工件被推送到gh-pages和其他分支时,此方法不会引起冲突。mvn回购您存储库的分支,每次mvn部署命令执行后,新的构建工件将被发布。
首先,必须将Maven工件部署到build / target目录中的临时位置。 将以下存储库添加到项目pom.xml中:
<distributionManagement>
<repository>
<id>internal.repo</id>
<name>Temporary Staging Repository</name>
<url>file://${project.build.directory}/mvn-repo</url>
</repository>
</distributionManagement>
将maven-deploy-plugin配置添加到pom.xml:
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<altDep