在 github 上创建 Maven 存储库
Creating maven repository on github
尝试在 github 上创建我自己的 Maven 存储库以在其他 Maven 项目中导入我的 java 库。但我采取异常错误创建 blob:未找到 (404)。谁能帮忙解决这个问题?
当我尝试“mvn clean deploy”时:
[ERROR] Failed to execute goal com.github.github:site-maven-plugin:0.12:site (default) on project mavenRepoTest: Error creating blob: Not Found (404) -> [Help 1]
我的pom.xml
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>mavenRepoTest</artifactId>
<version>1.0-SNAPSHOT</version>
<distributionManagement>
<repository>
<id>internal.repo</id>
<name>Temporary Staging Repository</name>
<url>file://${project.build.directory}/mvn-repo</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<altDeploymentRepository>
internal.repo::default::file://${project.build.directory}/mvn-repo
</altDeploymentRepository>
</configuration>
</plugin>
<plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>0.12</version>
<configuration>
<message>Maven artifacts for ${project.version}</message>
<noJekyll>true</noJekyll>
<outputDirectory>${project.build.directory}/mvn-repo</outputDirectory>
<branch>refs/heads/mvn-repo</branch>
<merge>true</merge>
<includes>
<include>**/*</include>
</includes>
<repositoryName>https://github.com/Dilitand1/mavenRepoTest</repositoryName>
<repositoryOwner>Dilitand1</repositoryOwner>
<server>github</server>
</configuration>
<executions>
<execution>
<goals>
<goal>site</goal>
</goals>
<phase>deploy</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
当对 Maven 使用 Github 的 Site Plugin 时,repositoryName
必须只是存储库的名称,在这种情况下 mavenRepoTest
.
像这样将服务器添加到您的 Maven 属性中:
<properties>
<github.global.server>github</github.global.server>
</properties>
还要确保你的 GitHub credentials/OAuth2-Token 可以被 maven 访问,例如将它们放入你的 .m2/settings.xml
:
<settings>
<servers>
<server>
<id>github</id>
<password>your-oauth-token-here</password>
</server>
</servers>
</settings>
尝试在 github 上创建我自己的 Maven 存储库以在其他 Maven 项目中导入我的 java 库。但我采取异常错误创建 blob:未找到 (404)。谁能帮忙解决这个问题?
当我尝试“mvn clean deploy”时:
[ERROR] Failed to execute goal com.github.github:site-maven-plugin:0.12:site (default) on project mavenRepoTest: Error creating blob: Not Found (404) -> [Help 1]
我的pom.xml
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>mavenRepoTest</artifactId>
<version>1.0-SNAPSHOT</version>
<distributionManagement>
<repository>
<id>internal.repo</id>
<name>Temporary Staging Repository</name>
<url>file://${project.build.directory}/mvn-repo</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<altDeploymentRepository>
internal.repo::default::file://${project.build.directory}/mvn-repo
</altDeploymentRepository>
</configuration>
</plugin>
<plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>0.12</version>
<configuration>
<message>Maven artifacts for ${project.version}</message>
<noJekyll>true</noJekyll>
<outputDirectory>${project.build.directory}/mvn-repo</outputDirectory>
<branch>refs/heads/mvn-repo</branch>
<merge>true</merge>
<includes>
<include>**/*</include>
</includes>
<repositoryName>https://github.com/Dilitand1/mavenRepoTest</repositoryName>
<repositoryOwner>Dilitand1</repositoryOwner>
<server>github</server>
</configuration>
<executions>
<execution>
<goals>
<goal>site</goal>
</goals>
<phase>deploy</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
当对 Maven 使用 Github 的 Site Plugin 时,repositoryName
必须只是存储库的名称,在这种情况下 mavenRepoTest
.
像这样将服务器添加到您的 Maven 属性中:
<properties>
<github.global.server>github</github.global.server>
</properties>
还要确保你的 GitHub credentials/OAuth2-Token 可以被 maven 访问,例如将它们放入你的 .m2/settings.xml
:
<settings>
<servers>
<server>
<id>github</id>
<password>your-oauth-token-here</password>
</server>
</servers>
</settings>