You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Gradle项目发布Azure Artifacts显示成功但Feed无内容,如何解决?

发布Jar到Azure Artifacts显示成功但Feed无内容的问题

我使用命令./gradlew publish将Jar包发布到Azure Artifacts,执行过程无任何错误,Gradle提示发布成功,甚至堆栈跟踪也显示命令执行完成。但打开Azure Artifacts的Feed后,却看不到相关内容。我还尝试了./gradlew publishAllPublicationsToMyFeedRepository命令,结果依旧如此。

以下是我尝试过的多种配置组合:

build.gradle

plugins { 
    id 'java-library' apply true
    id "net.linguica.maven-settings" version "0.5" apply true
    id 'maven-publish' apply true
}
dependencies {
    testImplementation 'org.junit.jupiter:junit-jupiter:5.6.2'
}
test {
    useJUnitPlatform()
}
jar {
    manifest {
        attributes('Main-Class': 'com.myapp.LanguageApp.SayHello')
    }
}
repositories {
    mavenCentral()
    mavenLocal()
    // maven {
    //     credentials {
    //      // 我已将用户名替换为PAT名称,密码替换为PAT令牌
    //             username "username"
    //             password "password"
    //     }
    //     url 'https://pkgs.dev.azure.com/username/azure-artifacts/_packaging/MyFeed/maven/v1'
    //     name 'MyFeed'
    //     authentication {
    //         basic(BasicAuthentication)
    //     }
    // }
}
publishing {
    publications {}
    repositories {
        maven {
            url 'https://pkgs.dev.azure.com/username/azure-artifacts/_packaging/MyFeed/maven/v1'
            name 'MyFeed'
            // authentication {
            //     basic(BasicAuthentication)
            // }
            credentials {
            // 我已将用户名替换为PAT名称,密码替换为PAT令牌
                username "username"
                password "password"
            }
        }
    }
}

settings.gradle

rootProject.name = 'gradle-project'

~/.m2/settings.xml

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                              https://maven.apache.org/xsd/settings-1.0.0.xsd">
  <servers>
    <server>
      <id>MyFeed</id>
      <!-- 是的,我已将用户名替换为PAT名称,密码替换为PAT令牌 -->
      <username>username</username>
      <password>password</password>
    </server>
  </servers>
</settings>

内容的提问来源于stack exchange,提问作者Mina F

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.02 19:56:13