【问题标题】:cannot find my jar in private maven repository在私有 Maven 存储库中找不到我的 jar
【发布时间】:2013-03-18 16:13:59
【问题描述】:

当我在 Jenkins 中运行构建时,它成功了,我也能够部署它。 但我在我的 Maven 存储库私有/发布位置找不到我的 jar 文件

https://repository-ram-cloud.forge.cloudbees.com/release/

这是 Jenkins 控制台输出

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
Projects to build: [MavenProject: com.uhg.jcoe:osa-common:1.0.0 @ /scratch/jenkins/workspace/osa-common build/pom.xml]
[JENKINS] Archiving /scratch/jenkins/workspace/osa-common build/pom.xml to /home/ram-cloud/hudson_home/jobs/osa-common build/modules/com.uhg.jcoe$osa-common/builds/2013-03-16_19-13-30/archive/com.uhg.jcoe/osa-common/1.0.0/osa-common-1.0.0.pom
[JENKINS] Archiving /scratch/jenkins/workspace/osa-common build/target/osa-common-1.0.0.jar to /home/ram-cloud/hudson_home/jobs/osa-common build/modules/com.uhg.jcoe$osa-common/builds/2013-03-16_19-13-30/archive/com.uhg.jcoe/osa-common/1.0.0/osa-common-1.0.0.jar
Waiting for Jenkins to finish collecting data
channel stopped
[cloudbees-deployer] Deploying as (jenkins) to the ram-cloud account

看到它说它已部署到 ram-cloud 帐户,但我看不到它,这就是我的其他项目失败的原因,因为它们有这个 jar 依赖项。

【问题讨论】:

  • 你能发布更完整的日志吗? BUILD SUCCESS 之前的行。正在运行什么 mvn 命令?
  • 你告诉 Jenkins 构建的 Maven 目标是什么?
  • 当然。 [信息] 将 /scratch/jenkins/workspace/osa-common build/target/osa-common-1.0.0.jar 安装到 /home/jenkins/.m2/repository/com/uhg/jcoe/osa-common/1.0。 0/osa-common-1.0.0.jar [INFO] 安装 /scratch/jenkins/workspace/osa-common build/pom.xml 到 /home/jenkins/.m2/repository/com/uhg/jcoe/osa-common /1.0.0/osa-common-1.0.0.pom mojoSucceeded org.apache.maven.plugins:maven-install-plugin:2.3.1(default-install) projectSucceeded com.uhg.jcoe:osa-common:1.0。 0 会话结束
  • 执行 Maven:-B -f /scratch/jenkins/workspace/osa-common build/pom.xml install [INFO] 扫描项目...
  • [debug] 执行 contextualize [INFO] 使用 'UTF-8' 编码复制过滤的资源。 [INFO] 复制 1 个资源 mojoSucceeded org.apache.maven.plugins:maven-resources-plugin:2.5(default-resources) mojoStarted org.apache.maven.plugins:maven-compiler-plugin:2.3.2(default-compile) [INFO] [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ osa-common ---

标签: maven repository local cloudbees


【解决方案1】:

您在日志中看到的是 jenkins 归档构建的结果,但这只是 Jenkins 的一项功能,与 maven 存储库无关。要使此工件可用于其他作业,您需要配置构建后操作“部署到我的 maven 存储库”并选择“发布”。

【讨论】:

    【解决方案2】:

    评论混淆解决方案的粗略总结是:

    您需要告诉 maven 实际部署工件,以便它们在构建之间可用:

    maven clean deploy
    

    您的 POM 还需要正确配置 - 根据 CloudBees Private Maven Repository

    【讨论】:

      猜你喜欢
      • 2016-06-23
      • 2010-11-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-01
      • 2017-01-04
      • 2013-01-25
      相关资源
      最近更新 更多