首页 > 解决方案 > 我无法将我的 API 上传到 github 包

问题描述

我花了一整天的时间试图解决这个问题,但我仍然无法做到......

这就是您寻求帮助的原因,目前我正在尝试将我的 API 放在 github 包系统上,因此我使用 maven-deploy 并遵循 GitHub https://docs.github提供的所有教程.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry

但是当我在部署步骤时,我得到了这个错误,当然我已经使用我的 GitHub 帐户进行了身份验证

Transfer failed for https://maven.pkg.github.com/BDoryan/backdoor-repository/isotopestudio/backdoor/core/BackdoorCore/1.0.0/BackdoorCore-1.0.0.jar 422 Unprocessable Entity

pom.xml

<groupId>isotopestudio.backdoor.core</groupId>
<artifactId>BackdoorCore</artifactId>
<version>1.0.0</version>

<build>
    <finalName>backdoorcore</finalName>
</build>

<distributionManagement>
    <repository>
        <id>github</id>
        <name>Backdoor Repository</name>
        <url>https://maven.pkg.github.com/BDoryan/backdoor-repository</url>
    </repository>
</distributionManagement>

设置.xml

<activeProfiles>
    <activeProfile>github</activeProfile>
</activeProfiles>

<profiles>
    <profile>
        <id>github</id>
        <repositories>
            <repository>
                <id>central</id>
                <url>https://repo1.maven.org/maven2</url>
                <releases><enabled>true</enabled></releases>
                <snapshots><enabled>true</enabled></snapshots>
            </repository>
            <repository>
                <id>github</id>
                <url>https://maven.pkg.github.com/BDoryan/backdoor-repository</url>
            </repository>
        </repositories>
    </profile>
</profiles>

<servers>
    <server>
        <id>github</id>
        <username>BDoryan</username>
        <password>my_token</password>
    </server>
</servers>

对不起,如果我的英语不好,我使用翻译应用程序

标签: javamavengithubpackageartifacts

解决方案


推荐阅读