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

求助:JFrog Artifactory中Artifact无法部署的问题

Artifact无法部署到JFrog Artifactory的排查与解决

核心原因分析

从你提供的控制台日志里,能直接定位到两个导致部署失败的关键触发点:

  1. Maven Deploy插件的skip参数被设置为true,部署步骤直接被跳过:
    [BuilderThread 0] DEBUG org.jfrog.build.extractor.maven.resolver.ArtifactoryEclipsePluginManager -   (f) skip = true
    [BuilderThread 0] INFO org.apache.maven.plugin.deploy.DeployMojo - Skipping artifact deployment
    
  2. Artifactory构建信息记录器的deploy artifacts参数为false,明确不会执行制品部署:
    [main] INFO org.jfrog.build.extractor.maven.BuildDeploymentHelper - Artifactory Build Info Recorder: deploy artifacts set to false, artifacts will not be deployed...
    

另外还有一个细节需要注意:你的pom.xml中项目版本是2.0-SNAPSHOT,但日志里显示的构建版本是1.0-SNAPSHOT,需要确认构建时是否使用了正确的pom文件,或者是否有参数覆盖了版本号。

解决方案

1. 取消部署跳过配置

  • 若构建时通过命令行添加了-DskipDeploy=true这类参数,执行构建时移除该参数,使用完整部署命令:
    mvn clean deploy
    
  • 若使用Jenkins等CI工具,检查构建配置是否勾选了「Skip deploy」选项,取消该勾选;
  • 检查pom.xml或全局settings.xml中是否存在强制跳过部署的插件配置,确保设置为false:
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-deploy-plugin</artifactId>
      <configuration>
        <skip>false</skip>
      </configuration>
    </plugin>
    

2. 启用Artifactory制品部署

如果使用JFrog Artifactory Maven插件,确保开启部署选项:

  • 在Jenkins的Artifactory集成配置中,勾选「Deploy artifacts to Artifactory」;
  • 若通过pom.xml配置插件,确保相关参数正确设置:
    <plugin>
      <groupId>org.jfrog.buildinfo</groupId>
      <artifactId>artifactory-maven-plugin</artifactId>
      <version>3.2.2</version>
      <executions>
        <execution>
          <id>build-info</id>
          <goals>
            <goal>publish</goal>
          </goals>
          <configuration>
            <deployArtifacts>true</deployArtifacts>
            <publishBuildInfo>true</publishBuildInfo>
          </configuration>
        </execution>
      </executions>
    </plugin>
    

3. 确认版本一致性

  • 检查Jenkins工作目录中的pom.xml是否为最新的2.0-SNAPSHOT版本;
  • 排查是否存在命令行参数-Dproject.version=1.0-SNAPSHOT覆盖了pom中定义的版本号。

4. 验证Artifactory权限与配置

  • 确保构建使用的账号(如Jenkins服务器Maven配置中的账号)拥有目标仓库(libs-snapshot-local)的部署权限;
  • 确认pom.xml中distributionManagement的仓库ID与settings.xml里的服务器配置ID完全匹配:
    <!-- settings.xml中的服务器配置示例 -->
    <servers>
      <server>
        <id>local-release</id>
        <username>你的Artifactory用户名</username>
        <password>你的Artifactory密码/API密钥</password>
      </server>
      <server>
        <id>snapshots-local</id>
        <username>你的Artifactory用户名</username>
        <password>你的Artifactory密码/API密钥</password>
      </server>
    </servers>
    

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.28 04:33:08