簡體   English   中英

在 github 上創建 maven 存儲庫

[英]Creating maven repository on github

嘗試在 github 上創建我自己的 maven 存儲庫,以將我的 java 庫導入其他 Z031740C5D09BEE56B77 項目中但我接受了異常錯誤創建 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 的站點插件時, repositoryName只能是存儲庫的名稱,在本例中mavenRepoTest

將服務器添加到您的 maven 屬性中,如下所示:

<properties>
  <github.global.server>github</github.global.server>
</properties>

還要確保 maven 可以訪問您的 GitHub 憑據/OAuth2-Token,例如將它們放入您的.m2/settings.xml

<settings>
  <servers>
    <server>
      <id>github</id>
      <password>your-oauth-token-here</password>
    </server>
  </servers>
</settings>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM